mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
Moves the account email visibility control into Settings › Appearance (above Show Sidebar Items) and removes the page-level email reveal buttons from combos, logs, provider detail, provider quota, quota sharing, and the edit-connection modal. The global masking state is unchanged — existing account labels still consume the shared emailPrivacyStore — so one toggle now governs masking everywhere. The old EmailPrivacyToggle component is replaced by AccountEmailVisibilitySetting. Integrated into release/v3.8.25. Co-authored-by: R.D. <rogerproself@gmail.com>
26 lines
633 B
TypeScript
26 lines
633 B
TypeScript
"use client";
|
|
|
|
import { create } from "zustand";
|
|
import { persist } from "zustand/middleware";
|
|
|
|
interface EmailPrivacyState {
|
|
/** When true, all email addresses are shown in full (unmasked). Default: false (masked). */
|
|
emailsVisible: boolean;
|
|
/** Set the global email visibility state. */
|
|
setEmailsVisible: (visible: boolean) => void;
|
|
}
|
|
|
|
const useEmailPrivacyStore = create<EmailPrivacyState>()(
|
|
persist(
|
|
(set) => ({
|
|
emailsVisible: false,
|
|
setEmailsVisible: (visible) => set({ emailsVisible: visible }),
|
|
}),
|
|
{
|
|
name: "omniroute-email-privacy",
|
|
}
|
|
)
|
|
);
|
|
|
|
export default useEmailPrivacyStore;
|