mirror of
https://github.com/YuzuZensai/VRC-Circle.git
synced 2026-09-14 03:10:01 +00:00
✨ feat: Implement VRChat protocol handling for macOS
This commit is contained in:
@@ -41,6 +41,16 @@ function screenshotState(): EnhancementState {
|
||||
|
||||
function protocolState(): EnhancementState {
|
||||
const s = protocol.status();
|
||||
// isDefaultProtocolClient stays true after disabling on macOS/Windows; trust the pref instead
|
||||
if (platform() !== "linux") {
|
||||
const pref = readPrefs()["vrchat-protocol-handler"];
|
||||
const enabled = pref ?? s.registered;
|
||||
return {
|
||||
id: "vrchat-protocol-handler",
|
||||
enabled,
|
||||
detail: { key: enabled ? "registered" : "notRegistered" },
|
||||
};
|
||||
}
|
||||
return { id: "vrchat-protocol-handler", enabled: s.registered, detail: s.detail };
|
||||
}
|
||||
|
||||
@@ -48,6 +58,10 @@ export function snapshot(): EnhancementsSnapshot {
|
||||
return { platform: platform(), states: [screenshotState(), protocolState()] };
|
||||
}
|
||||
|
||||
export function isEnabled(id: EnhancementId): boolean {
|
||||
return readPrefs()[id] ?? false;
|
||||
}
|
||||
|
||||
export async function setEnabled(
|
||||
id: EnhancementId,
|
||||
enabled: boolean,
|
||||
|
||||
Reference in New Issue
Block a user