mirror of
https://github.com/vibegif/vibegif.lol.git
synced 2026-04-07 02:12:12 +00:00
Feat: LocalStorage API key persistence
This commit is contained in:
13
storage.js
Normal file
13
storage.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
const KEY = 'vibegif_api_key';
|
||||||
|
|
||||||
|
export function getApiKey() {
|
||||||
|
return localStorage.getItem(KEY) || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setApiKey(k) {
|
||||||
|
localStorage.setItem(KEY, k.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
export function hasApiKey() {
|
||||||
|
return !!getApiKey();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user