Skip to content

Commit

Permalink
Merge pull request #58 from opcodesio/bug/make-sure-new-log-file-iden…
Browse files Browse the repository at this point in the history
…tifiers-are-backwards-compatible

make sure the new log file identifiers are backwards compatible
  • Loading branch information
arukompas authored Sep 2, 2022
2 parents 8c9cd25 + 8047931 commit 93389df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
Route::get('/', function () {
LogViewer::auth();

$selectedFile = LogViewer::getFile(request()->query('file', ''));

return view('log-viewer::index', [
'jsPath' => __DIR__.'/../public/app.js',
'cssPath' => __DIR__.'/../public/app.css',
'selectedFileIdentifier' => request()->query('file', ''),
'selectedFileIdentifier' => $selectedFile?->identifier,
]);
})->name('blv.index');

Expand Down
6 changes: 3 additions & 3 deletions src/Http/Livewire/LogList.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public function mount()
{
$this->loadPreferences();

if (! LogViewer::getFile($this->selectedFileIdentifier)) {
$this->selectedFileIdentifier = null;
}
$file = LogViewer::getFile($this->selectedFileIdentifier);

$this->selectedFileIdentifier = $file?->identifier;
}

public function render()
Expand Down

0 comments on commit 93389df

Please sign in to comment.