chore: update workspace dependencies and chat behavior
- Adjust package metadata and lockfiles across the workspace - Refine chat sidebar and auto-scroll behavior in the UI - Update PWA install handling alongside runtime package changes
This commit is contained in:
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import { toast } from '@/components/ui';
|
||||
import { isWebRuntime } from '@/lib/desktop';
|
||||
import { usePwaDetection } from '@/hooks/usePwaDetection';
|
||||
import { getSafeSessionStorage } from '@/stores/utils/safeStorage';
|
||||
|
||||
type InstallPromptOutcome = 'accepted' | 'dismissed';
|
||||
|
||||
@@ -10,6 +11,8 @@ type BeforeInstallPromptEvent = Event & {
|
||||
userChoice: Promise<{ outcome: InstallPromptOutcome }>;
|
||||
};
|
||||
|
||||
const INSTALL_TOAST_SESSION_KEY = 'pwa-install-toast-shown';
|
||||
|
||||
export const usePwaInstallPrompt = () => {
|
||||
const { browserTab } = usePwaDetection();
|
||||
|
||||
@@ -54,10 +57,17 @@ export const usePwaInstallPrompt = () => {
|
||||
installEvent.preventDefault();
|
||||
deferredPrompt = installEvent;
|
||||
|
||||
const sessionStorage = getSafeSessionStorage();
|
||||
if (sessionStorage.getItem(INSTALL_TOAST_SESSION_KEY) === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (installToastId !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
sessionStorage.setItem(INSTALL_TOAST_SESSION_KEY, 'true');
|
||||
|
||||
installToastId = toast.info('Install OpenChamber for quicker access', {
|
||||
duration: Infinity,
|
||||
action: {
|
||||
|
||||
Reference in New Issue
Block a user