This commit is contained in:
Arseni
2025-12-30 17:56:15 +03:00
parent f3ad4c2d4f
commit c3ec50c8e4
4 changed files with 64 additions and 77 deletions

View File

@@ -84,12 +84,9 @@ class QuotationProvider extends ChangeNotifier {
return _lastRequestSignature == _signature(_pendingIntent!);
}
bool get hasLiveQuote =>
_isLoaded &&
!_isExpired &&
!_quotation.isLoading &&
_quotation.error == null &&
quotation != null;
bool get isReady => _isLoaded && !_isExpired && !_quotation.isLoading && _quotation.error == null;
bool get hasLiveQuote => isReady && quotation != null;
Duration? get timeToExpire {
final expiresAt = _quoteExpiry;
@@ -176,9 +173,10 @@ class QuotationProvider extends ChangeNotifier {
void refreshNow({bool force = true}) {
_debounceTimer?.cancel();
if (!_organizationAttached) return;
if (_pendingIntent == null) {
_reset();
if (!canRequestQuote) {
if (_pendingIntent == null) {
_reset();
}
return;
}
unawaited(_requestQuotation(_pendingIntent!, force: force));