From 9e6d170be0d255600ef53aeac430537e3e9c3d35 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 21 二月 2023 10:48:33 +0800 Subject: [PATCH] 2023-02-21 --- src/tabviews/custom/components/code/sand-box/index.jsx | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tabviews/custom/components/code/sand-box/index.jsx b/src/tabviews/custom/components/code/sand-box/index.jsx index a9edce6..923fd18 100644 --- a/src/tabviews/custom/components/code/sand-box/index.jsx +++ b/src/tabviews/custom/components/code/sand-box/index.jsx @@ -97,7 +97,7 @@ Api.getLCacheConfig(config.uuid).then(res => { if (!res || this.loaded) return - this.setState({data: res[0]}, () => { + this.setState({data: res}, () => { this.renderView() }) }) @@ -129,13 +129,13 @@ this.loaded = true - this.setState({sync: false, data: _data}) - if (!is(fromJS(this.state.data), fromJS(_data))) { setTimeout(() => { this.renderView() }, 10) } + + this.setState({sync: false, data: _data}) } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { this.setState({}, () => { this.loadData() @@ -193,16 +193,16 @@ Api.writeCacheConfig(config.uuid, result.data || '') } - this.setState({ - data: _data, - loading: false - }) - if (!is(fromJS(this.state.data), fromJS(_data))) { setTimeout(() => { this.renderView() }, 10) } + + this.setState({ + data: _data, + loading: false + }) } else { this.setState({ loading: false -- Gitblit v1.8.0