@@ -5,7 +5,7 @@ import debug from "debug";
55import * as jotai from "jotai" ;
66
77import { getOrCreateClientId } from "@/util/clientid" ;
8- import { adaptFromReactOrNativeKeyEvent , checkKeyPressed } from "@/util/keyutil" ;
8+ import { adaptFromReactOrNativeKeyEvent } from "@/util/keyutil" ;
99import { PLATFORM , PlatformMacOS } from "@/util/platformutil" ;
1010import { getDefaultStore } from "jotai" ;
1111import { applyCanvasOp , restoreVDomElems } from "./model-utils" ;
@@ -473,6 +473,9 @@ export class TsunamiModel {
473473 setAtomValue ( atomName : string , value : any , fromBe : boolean , idMap : Map < string , VDomElem > ) {
474474 dlog ( "setAtomValue" , atomName , value , fromBe ) ;
475475 let container = this . getAtomContainer ( atomName ) ;
476+ if ( container . val === value ) {
477+ return ;
478+ }
476479 container . val = value ;
477480 if ( fromBe ) {
478481 container . beVal = value ;
@@ -533,17 +536,17 @@ export class TsunamiModel {
533536 if ( faviconPath === this . cachedFaviconPath ) {
534537 return ;
535538 }
536-
539+
537540 this . cachedFaviconPath = faviconPath ;
538-
541+
539542 let existingFavicon = document . querySelector ( 'link[rel="icon"]' ) as HTMLLinkElement ;
540-
543+
541544 if ( faviconPath ) {
542545 if ( existingFavicon ) {
543546 existingFavicon . href = faviconPath ;
544547 } else {
545- const link = document . createElement ( ' link' ) ;
546- link . rel = ' icon' ;
548+ const link = document . createElement ( " link" ) ;
549+ link . rel = " icon" ;
547550 link . href = faviconPath ;
548551 document . head . appendChild ( link ) ;
549552 }
@@ -558,7 +561,7 @@ export class TsunamiModel {
558561 if ( update == null ) {
559562 return ;
560563 }
561-
564+
562565 // Check if serverId is changing and trigger remount if needed
563566 if ( this . serverId != null && this . serverId !== update . serverid ) {
564567 // Server ID changed - need to remount the entire app
@@ -567,7 +570,7 @@ export class TsunamiModel {
567570 }
568571 return ;
569572 }
570-
573+
571574 this . serverId = update . serverid ;
572575 getDefaultStore ( ) . set ( this . contextActive , true ) ;
573576 const idMap = new Map < string , VDomElem > ( ) ;
0 commit comments