fix(plugins/developer-settings): chain then on promise instead
Using await freezes the app on slower devices for some unknown reason...
This commit is contained in:
parent
406138d38e
commit
3903fe0a4b
1 changed files with 6 additions and 7 deletions
|
|
@ -33,18 +33,17 @@ registerPlugin<Storage>(
|
|||
load: true,
|
||||
default: defaultStorage,
|
||||
},
|
||||
async start(api_) {
|
||||
start(api_) {
|
||||
api = api_
|
||||
|
||||
if (isSettingsModulesLoaded()) require('./register')
|
||||
else onSettingsModulesLoaded(() => require('./register'))
|
||||
|
||||
const [rdt, settings] = await Promise.all([
|
||||
import('./react-devtools'),
|
||||
api.storage.get(),
|
||||
])
|
||||
|
||||
if (settings.devtools.autoConnect) rdt.connectToDevTools()
|
||||
Promise.all([import('./react-devtools'), api.storage.get()]).then(
|
||||
([rdt, settings]) => {
|
||||
if (settings.devtools.autoConnect) rdt.connectToDevTools()
|
||||
},
|
||||
)
|
||||
},
|
||||
},
|
||||
PluginFlags.Enabled,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue