mirror of
https://github.com/ichaly/cohere.git
synced 2026-07-22 07:47:20 +00:00
Include desktop OS in default device name
This commit is contained in:
parent
6d1e51d1b3
commit
a8c72da230
2 changed files with 16 additions and 1 deletions
|
|
@ -9,7 +9,10 @@ vi.mock("obsidian", () => ({
|
|||
Platform: {
|
||||
isAndroidApp: false,
|
||||
isIosApp: false,
|
||||
isLinux: false,
|
||||
isMacOS: true,
|
||||
isTablet: false,
|
||||
isWin: false,
|
||||
},
|
||||
Plugin: class {},
|
||||
PluginSettingTab: class {},
|
||||
|
|
@ -194,7 +197,7 @@ describe("device identity settings", () => {
|
|||
|
||||
await plugin.updateSettings({ deviceName: "" });
|
||||
|
||||
expect(plugin.settings.deviceName).toBe("Desktop KS5A");
|
||||
expect(plugin.settings.deviceName).toBe("Mac Desktop KS5A");
|
||||
expect(plugin.saveSettings).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
12
src/main.ts
12
src/main.ts
|
|
@ -378,6 +378,18 @@ function getCurrentDeviceName(deviceId: string): string {
|
|||
return `${Platform.isTablet ? "Android Tablet" : "Android Phone"} ${suffix}`;
|
||||
}
|
||||
|
||||
if (Platform.isMacOS) {
|
||||
return `Mac Desktop ${suffix}`;
|
||||
}
|
||||
|
||||
if (Platform.isWin) {
|
||||
return `Windows Desktop ${suffix}`;
|
||||
}
|
||||
|
||||
if (Platform.isLinux) {
|
||||
return `Linux Desktop ${suffix}`;
|
||||
}
|
||||
|
||||
return `Desktop ${suffix}`;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue