mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
27 lines
644 B
TypeScript
27 lines
644 B
TypeScript
import { StorageSerializers } from "@vueuse/core";
|
|
import type { Mastodon } from "megalodon";
|
|
import type { Instance } from "~/types/mastodon/instance";
|
|
|
|
export type InstanceWithExtra = Instance & {
|
|
banner: string | null;
|
|
lysand_version: string;
|
|
sso: {
|
|
forced: boolean;
|
|
providers: {
|
|
id: string;
|
|
name: string;
|
|
icon?: string;
|
|
}[];
|
|
};
|
|
};
|
|
|
|
export const useInstance = () => {
|
|
if (process.server) {
|
|
return ref(null);
|
|
}
|
|
|
|
return useLocalStorage<InstanceWithExtra | null>("lysand:instance", null, {
|
|
serializer: StorageSerializers.object,
|
|
});
|
|
};
|