mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
refactor(music-together): migrate music-together plugin (vanilla to solid-js)
This commit is contained in:
28
src/plugins/music-together/store/status.ts
Normal file
28
src/plugins/music-together/store/status.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { createStore } from 'solid-js/store';
|
||||
|
||||
import { ConnectedState, Permission, User } from '../types';
|
||||
|
||||
// export const getDefaultProfile = (
|
||||
// connectionID: string,
|
||||
// id: string = Date.now().toString(36),
|
||||
// ): User => {
|
||||
// const name = `Guest ${id.slice(-6)}`;
|
||||
//
|
||||
// return {
|
||||
// id: connectionID,
|
||||
// handleId: `#music-together:${id}`,
|
||||
// name,
|
||||
// thumbnail: `https://ui-avatars.com/api/?name=${name}&background=random`,
|
||||
// };
|
||||
// };
|
||||
|
||||
export type StatusStoreType = {
|
||||
mode: ConnectedState;
|
||||
permission: Permission;
|
||||
users: User[];
|
||||
};
|
||||
export const [status, setStatus] = createStore<StatusStoreType>({
|
||||
mode: 'disconnected',
|
||||
permission: 'all',
|
||||
users: [],
|
||||
});
|
||||
Reference in New Issue
Block a user