Remove redundant if statement
This commit is contained in:
parent
f774452124
commit
8d413670c8
@ -525,7 +525,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||||||
let zenModeEnabled = actionResult?.appState?.zenModeEnabled || false;
|
let zenModeEnabled = actionResult?.appState?.zenModeEnabled || false;
|
||||||
let gridSize = actionResult?.appState?.gridSize || null;
|
let gridSize = actionResult?.appState?.gridSize || null;
|
||||||
let theme = actionResult?.appState?.theme || "light";
|
let theme = actionResult?.appState?.theme || "light";
|
||||||
let name = actionResult?.appState?.name || this.state.name;
|
const name = actionResult?.appState?.name || this.state.name;
|
||||||
|
|
||||||
if (typeof this.props.viewModeEnabled !== "undefined") {
|
if (typeof this.props.viewModeEnabled !== "undefined") {
|
||||||
viewModeEnabled = this.props.viewModeEnabled;
|
viewModeEnabled = this.props.viewModeEnabled;
|
||||||
@ -543,10 +543,6 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||||||
theme = this.props.theme;
|
theme = this.props.theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof this.props.name !== "undefined") {
|
|
||||||
name = this.props.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setState(
|
this.setState(
|
||||||
(state) => {
|
(state) => {
|
||||||
// using Object.assign instead of spread to fool TS 4.2.2+ into
|
// using Object.assign instead of spread to fool TS 4.2.2+ into
|
||||||
|
Loading…
x
Reference in New Issue
Block a user