feat: add stable macOS app download to website
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
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
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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 };
|
||||
}
|
||||
Reference in New Issue
Block a user