add profile, messages, and connectionStatus shared state
This commit is contained in:
parent
308dbe2b4e
commit
81b4d018fb
9 changed files with 44 additions and 17 deletions
27
src/render/shared/profile.ts
Normal file
27
src/render/shared/profile.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// shared
|
||||
import { ref } from "vue";
|
||||
|
||||
export const profile = ref();
|
||||
|
||||
export const authComplete = ref(false);
|
||||
|
||||
export const setProfile: IpcListenerCallback<Profile | null> = (payload) => {
|
||||
payload ? profile.value = payload : clearProfile();
|
||||
showRender();
|
||||
};
|
||||
|
||||
export const clearProfile = () => {
|
||||
profile.value = null;
|
||||
};
|
||||
|
||||
export const showRender = () => {
|
||||
authComplete.value = true;
|
||||
};
|
||||
|
||||
export default {
|
||||
setProfile,
|
||||
clearProfile,
|
||||
profile,
|
||||
showRender,
|
||||
authComplete,
|
||||
};
|
||||
Loading…
Reference in a new issue