FIX: Don not clone Locales and Languages, pass them by reference
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import type { Model } from "@ironcalc/wasm";
|
||||
import { styled, Tooltip } from "@mui/material";
|
||||
import { EllipsisVertical, Menu, Plus } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
@@ -11,7 +12,6 @@ import type { WorkbookState } from "../workbookState";
|
||||
import SheetListMenu from "./SheetListMenu";
|
||||
import SheetTab from "./SheetTab";
|
||||
import type { SheetOptions } from "./types";
|
||||
import { Model } from "@ironcalc/wasm";
|
||||
|
||||
export interface SheetTabBarProps {
|
||||
sheets: SheetOptions[];
|
||||
@@ -131,7 +131,7 @@ function SheetTabBar(props: SheetTabBarProps) {
|
||||
open={workbookSettingsOpen}
|
||||
onClose={() => setWorkbookSettingsOpen(false)}
|
||||
initialLocale={props.model.getLocale()}
|
||||
initialTimezone={ props.model.getTimezone()}
|
||||
initialTimezone={props.model.getTimezone()}
|
||||
initialLanguage={props.model.getLanguage()}
|
||||
onSave={(locale: string, timezone: string, language: string) => {
|
||||
props.onSettingsChange(locale, timezone, language);
|
||||
|
||||
@@ -139,8 +139,7 @@ export function saveSelectedModelInStorage(model: Model) {
|
||||
modelsJson = "{}";
|
||||
}
|
||||
const models: ModelsMetadata = JSON.parse(modelsJson);
|
||||
models[uuid].language = model.getLanguage(),
|
||||
|
||||
models[uuid].language = model.getLanguage();
|
||||
localStorage.setItem("models", JSON.stringify(models));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user