UNPKG

@replyke/react-js

Version:

Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.

33 lines 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@replyke/core"); const STORAGE_KEY_PREFIX = "replyke-accounts:"; const webAccountStorage = { async getAccountMap(projectId) { try { const raw = localStorage.getItem(`${STORAGE_KEY_PREFIX}${projectId}`); return raw ? JSON.parse(raw) : null; } catch { return null; } }, async setAccountMap(projectId, map) { try { localStorage.setItem(`${STORAGE_KEY_PREFIX}${projectId}`, JSON.stringify(map)); } catch (error) { (0, core_1.handleError)(error, "Failed to write account map to localStorage"); } }, async deleteAccountMap(projectId) { localStorage.removeItem(`${STORAGE_KEY_PREFIX}${projectId}`); }, }; function AccountManager() { const { projectId } = (0, core_1.useProject)(); (0, core_1.useAccountSync)(webAccountStorage, projectId); return null; } exports.default = AccountManager; //# sourceMappingURL=AccountManager.js.map