Refactor: Isolate API key storage

This commit is contained in:
2026-03-20 22:57:30 -07:00
parent ebafbc15cc
commit 3e1dc021e8

13
src/core/storage.js Normal file
View File

@@ -0,0 +1,13 @@
export const STORAGE_KEY = 'vibegif_api_key';
export function getApiKey() {
return localStorage.getItem(STORAGE_KEY) || '';
}
export function setApiKey(key) {
localStorage.setItem(STORAGE_KEY, (key || '').trim());
}
export function hasApiKey() {
return !!getApiKey();
}