CI/CD / preconditions (pull_request) Successful in 1s
Native JavaScript checks / Native launcher and release tests (pull_request) Successful in 1m3s
macOS checks / Native Rust tests and unsigned build (pull_request) Successful in 1m41s
CI/CD / test_and_check_app (pull_request) Successful in 6m53s
CI/CD / Publish immutable image (pull_request) Skipped
31 lines
781 B
TypeScript
31 lines
781 B
TypeScript
import { onMounted, ref } from 'vue';
|
|
import updateSource from '../../../native/update-source.json';
|
|
|
|
export const macDownloadUrl = `${updateSource.baseUrl}/aarch64-apple-darwin/KanbanGit.dmg`;
|
|
|
|
export function isMacDownloadAvailable(
|
|
userAgent: string,
|
|
maxTouchPoints: number,
|
|
isTauri: unknown,
|
|
): boolean {
|
|
return (
|
|
userAgent.includes('Macintosh') &&
|
|
maxTouchPoints < 2 &&
|
|
isTauri !== true
|
|
);
|
|
}
|
|
|
|
export function useMacDownload() {
|
|
const showMacDownload = ref(false);
|
|
|
|
onMounted(() => {
|
|
showMacDownload.value = isMacDownloadAvailable(
|
|
navigator.userAgent,
|
|
navigator.maxTouchPoints,
|
|
Reflect.get(window, 'isTauri'),
|
|
);
|
|
});
|
|
|
|
return { macDownloadUrl, showMacDownload };
|
|
}
|