Compare commits

..
Author SHA1 Message Date
afea4cf39f chore(deps): update rust crate base64 to 0.23
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
Dependency builds / Build web (pull_request) Successful in 5m38s
Dependency builds / Build mobile (pull_request) Failing after 8m2s
Dependency builds / Build desktop (pull_request) Successful in 9m26s
2026-08-19 00:00:25 +03:00
forgejo-actions
57c7ceb27a (qol): update release flake hash 2026-08-18 20:46:45 +00:00
caa7d65b84
feat(pwa): remove install prompt
All checks were successful
Dependency builds / Build web (pull_request) Has been skipped
Dependency builds / Build desktop (pull_request) Has been skipped
Dependency builds / Build mobile (pull_request) Has been skipped
/ build-web (push) Successful in 5m40s
/ build-desktop (linux) (push) Successful in 10m33s
/ build-mobile (push) Successful in 23m6s
/ release (push) Successful in 2m15s
2026-08-18 21:40:57 +02:00
4 changed files with 14 additions and 61 deletions

View file

@ -3,6 +3,7 @@
"entry": [
"src/index.{ts,tsx,js,jsx}",
"src/main.{ts,tsx,js,jsx}",
"apps/pwa/src/serviceWorker.ts",
"apps/tauri/render-version.ts",
"packages/**/*.test.ts"
],

View file

@ -1,4 +1,4 @@
import { useEffect, useState } from "react";
import { useEffect } from "react";
import { toast } from "sonner";
import { setDatabaseEntry } from "@tensamin/shared/indexedDb";
@ -6,11 +6,6 @@ import { isTauri } from "@tauri-apps/api/core";
import "./style.css";
type BeforeInstallPromptEvent = Event & {
prompt: () => Promise<void>;
userChoice: Promise<{ outcome: "accepted" | "dismissed" }>;
};
const launchedFiles: File[] = [];
const fileListeners = new Set<(file: File) => void>();
@ -66,9 +61,6 @@ async function enablePush() {
}
export default function PwaRuntime() {
const [installPrompt, setInstallPrompt] =
useState<BeforeInstallPromptEvent | null>(null);
useEffect(() => {
if (
isTauri() ||
@ -129,16 +121,6 @@ export default function PwaRuntime() {
};
}, []);
useEffect(() => {
const handleInstallPrompt = (event: Event) => {
event.preventDefault();
setInstallPrompt(event as BeforeInstallPromptEvent);
};
window.addEventListener("beforeinstallprompt", handleInstallPrompt);
return () =>
window.removeEventListener("beforeinstallprompt", handleInstallPrompt);
}, []);
useEffect(() => {
const launchQueue = (
window as Window & {
@ -158,39 +140,6 @@ export default function PwaRuntime() {
});
}, []);
useEffect(() => {
if (!installPrompt) return;
toast("Install Tensamin for a native app experience", {
duration: Infinity,
action: {
label: "Install",
onClick: () => {
void installPrompt.prompt().then(() => installPrompt.userChoice);
setInstallPrompt(null);
},
},
});
}, [installPrompt]);
useEffect(() => {
const isAppleMobile = /iPad|iPhone|iPod/.test(navigator.userAgent);
if (
isTauri() ||
!isAppleMobile ||
isStandalone() ||
localStorage.getItem("pwa-ios-install-hint")
) {
return;
}
localStorage.setItem("pwa-ios-install-hint", "shown");
toast(
"Install Tensamin from Safari's Share menu to enable background notifications.",
{
duration: 12_000,
},
);
}, []);
useEffect(() => {
if (
!isStandalone() ||

View file

@ -34,19 +34,22 @@ function isPushPayload(value: unknown): value is PushPayload {
const message = payload.message as
Partial<PushPayload["message"]> | undefined;
const secret = payload.secret as Partial<PushPayload["secret"]> | undefined;
const stringValues = [
payload.sender,
message?.content,
secret?.chatId,
secret?.secretId,
secret?.encryptedSecret,
secret?.kemCiphertext,
secret?.wrappingScheme,
];
return (
payload.version === 1 &&
typeof payload.senderId === "number" &&
Number.isSafeInteger(payload.senderId) &&
payload.senderId > 0 &&
typeof payload.sender === "string" &&
typeof message?.content === "string" &&
typeof secret?.chatId === "string" &&
typeof secret.secretId === "string" &&
typeof secret.version === "number" &&
typeof secret.encryptedSecret === "string" &&
typeof secret.kemCiphertext === "string" &&
typeof secret.wrappingScheme === "string"
typeof secret?.version === "number" &&
stringValues.every((item) => typeof item === "string")
);
}

View file

@ -17,7 +17,7 @@
systems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
version = "0.0.11";
x86_64DebHash = "sha256-E4FGMpCt2ByaN6d+YzglqeA6LbhMOQmPf3UzAj7uZXE=";
x86_64DebHash = "sha256-p/6boNv9uWTHsPTVa3EhGzr41EwRzCY/fJWlj854DVA=";
forgejoBaseUrl = "https://git.methanium.net/tensamin/client/releases/download/${version}";
in
{