From bc19ac9d7defb62fcf55e4a591ae94c63bde663e Mon Sep 17 00:00:00 2001 From: Jehizkia Date: Tue, 31 Oct 2023 14:51:06 +0100 Subject: [PATCH] Bugfix: Removed offset from QuickTranslate.php --- src/Pages/QuickTranslate.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Pages/QuickTranslate.php b/src/Pages/QuickTranslate.php index f71f254..3c7ff16 100644 --- a/src/Pages/QuickTranslate.php +++ b/src/Pages/QuickTranslate.php @@ -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; @@ -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(); }), ]), @@ -87,7 +85,7 @@ public function saveAndContinue(): void $this->enteredTranslation = ''; // Go to the next item - $this->next(); + $this->update(); } /** @@ -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. */