feat(changelog): implement automated changelog fetching from GitHub and enhance changelog read tracking
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Jobs\PullChangelogFromGitHub;
|
||||
use App\Services\ChangelogService;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Component;
|
||||
@@ -42,6 +43,20 @@ class SettingsDropdown extends Component
|
||||
app(ChangelogService::class)->markAllAsReadForUser(Auth::user());
|
||||
}
|
||||
|
||||
public function manualFetchChangelog()
|
||||
{
|
||||
if (! isDev()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
PullChangelogFromGitHub::dispatch();
|
||||
$this->dispatch('success', 'Changelog fetch initiated! Check back in a few moments.');
|
||||
} catch (\Throwable $e) {
|
||||
$this->dispatch('error', 'Failed to fetch changelog: '.$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.settings-dropdown', [
|
||||
|
||||
@@ -75,7 +75,7 @@ class Index extends Component
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Log the error
|
||||
logger()->error('Stripe API error: ' . $e->getMessage());
|
||||
logger()->error('Stripe API error: '.$e->getMessage());
|
||||
// Set a flag to show an error message to the user
|
||||
$this->addError('stripe', 'Could not retrieve subscription information. Please try again later.');
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user