()
| 123 | } |
| 124 | |
| 125 | clearApiKey() { |
| 126 | this.state = { |
| 127 | apiKey: null, |
| 128 | apiKeyInfo: null, |
| 129 | expiresAt: null, |
| 130 | ticketUsed: null |
| 131 | }; |
| 132 | |
| 133 | if (typeof chatDB !== 'undefined' && chatDB.db) { |
| 134 | chatDB.saveSetting(ACCESS_DB_KEY, null).catch(() => {}); |
| 135 | } |
| 136 | localStorage.removeItem(ACCESS_STORAGE_KEY); |
| 137 | console.log('🗑️ Cleared API key'); |
| 138 | |
| 139 | window.dispatchEvent(new CustomEvent('apikey-cleared')); |
| 140 | this.notify(); |
| 141 | } |
| 142 | |
| 143 | getApiKey() { |
| 144 | return this.state.apiKey; |
nothing calls this directly
no test coverage detected