MCPcopy Create free account
hub / github.com/Roy3838/Observer / optimisticUpdateQuota

Method optimisticUpdateQuota

app/src/utils/ModelManager.ts:865–877  ·  view source on GitHub ↗
(credits: number = 4)

Source from the content-addressed store, hash-verified

863 }
864
865 private optimisticUpdateQuota(credits: number = 4): void {
866 try {
867 const key = 'observer-quota-remaining';
868 const current = localStorage.getItem(key);
869 if (current !== null) {
870 const n = parseInt(current, 10);
871 if (!isNaN(n)) {
872 localStorage.setItem(key, (n - credits).toString());
873 window.dispatchEvent(new CustomEvent('quotaUpdated'));
874 }
875 }
876 } catch {}
877 }
878}

Callers 3

sendPromptMethod · 0.95
sendMessagesMethod · 0.95
sendToolMessagesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected