Skip to content

Commit

Permalink
Bugfix: Removed offset from QuickTranslate.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Jehizkia committed Oct 31, 2023
1 parent 0cbc3ba commit bc19ac9
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/Pages/QuickTranslate.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class QuickTranslate extends Page implements HasForms
protected static string $resource = LanguageLineResource::class;

public $selectedLocale = null;
public $offset = 0;
public $record;
public $totalLanguageLines;
public $enteredTranslation;
Expand Down Expand Up @@ -54,7 +53,6 @@ public function getForms(): array
->label(__('translation-manager::translations.quick-translate-select-locale'))
->reactive()
->afterStateUpdated(function ($state) {
$this->offset = 0;
$this->update();
}),
]),
Expand Down Expand Up @@ -87,7 +85,7 @@ public function saveAndContinue(): void
$this->enteredTranslation = '';

// Go to the next item
$this->next();
$this->update();
}

/**
Expand All @@ -96,21 +94,11 @@ public function saveAndContinue(): void
public function update(): void
{
$this->record = LanguageLine::whereNull('text->' . $this->selectedLocale)
->offset($this->offset)
->first();

$this->totalLanguageLines = LanguageLine::whereNull('text->' . $this->selectedLocale)->count();
}

/**
* Navigate to the next record.
*/
public function next(): void
{
$this->offset++;
$this->update();
}

/**
* Returns the title of the page.
*/
Expand Down

0 comments on commit bc19ac9

Please sign in to comment.