mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-12-04 04:01:26 +00:00
786660161b
Add device profile to generate deviceId, deviceName, clientName, and clientVersion for userToken
38 lines
844 B
TypeScript
38 lines
844 B
TypeScript
import { MutationTree } from 'vuex';
|
|
|
|
export interface deviceProfile {
|
|
deviceId: string;
|
|
deviceName: string;
|
|
clientVersion: string;
|
|
clientName: string;
|
|
}
|
|
|
|
export const state = (): deviceProfile => ({
|
|
deviceId: '',
|
|
deviceName: '',
|
|
clientVersion: '',
|
|
clientName: ''
|
|
});
|
|
|
|
interface MutationPayload {
|
|
deviceId: string;
|
|
deviceName: string;
|
|
clientVersion: string;
|
|
clientName: string;
|
|
}
|
|
|
|
export const mutations: MutationTree<deviceProfile> = {
|
|
set(state: deviceProfile, payload: MutationPayload) {
|
|
state.deviceId = payload.deviceId;
|
|
state.deviceName = payload.deviceName;
|
|
state.clientVersion = payload.clientVersion;
|
|
state.clientName = payload.clientName;
|
|
},
|
|
clear(state: deviceProfile) {
|
|
state.deviceId = '';
|
|
state.deviceName = '';
|
|
state.clientVersion = '';
|
|
state.clientName = '';
|
|
}
|
|
};
|