fix(quotes): resolve external quote links across boards (#1064)

This commit is contained in:
Tommaso Casaburi
2026-03-12 17:41:11 +08:00
committed by GitHub
parent ef375e3578
commit fe55e6f332
58 changed files with 1719 additions and 92 deletions
@@ -0,0 +1,37 @@
import { create } from 'zustand';
interface ExternalQuoteStatusState {
message: string | null;
clearStatus: () => void;
setErrorStatus: (message: string) => void;
}
let hideTimeout: number | null = null;
const clearHideTimeout = () => {
if (hideTimeout !== null) {
window.clearTimeout(hideTimeout);
hideTimeout = null;
}
};
const scheduleHide = (clearStatus: () => void, delayMs: number) => {
clearHideTimeout();
hideTimeout = window.setTimeout(() => {
clearStatus();
}, delayMs);
};
const useExternalQuoteStatusStore = create<ExternalQuoteStatusState>((set, get) => ({
message: null,
clearStatus: () => {
clearHideTimeout();
set({ message: null });
},
setErrorStatus: (message: string) => {
set({ message });
scheduleHide(get().clearStatus, 4000);
},
}));
export default useExternalQuoteStatusStore;