upd: use computed on permissions

This commit is contained in:
Mar0xy 2023-11-03 00:27:27 +01:00
parent 4856699bd6
commit 335de75b66
No known key found for this signature in database
GPG Key ID: 56569BBE47D2C828
1 changed files with 2 additions and 1 deletions

View File

@ -60,7 +60,7 @@ const props = defineProps<{
permission: string; //
}>();
const _permissions = props.permission ? props.permission.split(',') : [];
const _permissions = $computed(() => props.permission ? props.permission.split(',') : []);
let state = $ref<string | null>(null);
@ -77,6 +77,7 @@ async function accept(): Promise<void> {
if (props.callback) {
const cbUrl = new URL(props.callback);
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:'].includes(cbUrl.protocol)) throw new Error('invalid url');
console.log(props.callback, props.session);
location.href = appendQuery(props.callback, query({ session: props.session }));
}
}