protected override async Task OnInitializedAsync() { Config = ConfigService.SelectedConfig; if (Config == null) { Nav.NavigateTo("/configs"); return; } // Transpile if not in CSharp mode if (Config != null && Config.Mode != ConfigMode.CSharp) { try { Config.CSharpScript = Config.Mode == ConfigMode.Stack ? Stack2CSharpTranspiler.Transpile(Config.Stack, Config.Settings) : Loli2CSharpTranspiler.Transpile(Config.LoliCodeScript, Config.Settings); } catch (Exception ex) { await OBLogger.LogException(ex); } } }
protected override async Task OnInitializedAsync() { config = ConfigService.SelectedConfig; if (config == null) { Nav.NavigateTo("/configs"); return; } try { config.ChangeMode(ConfigMode.Stack); } catch (Exception ex) { await OBLogger.LogException(ex); await js.AlertError(ex.GetType().Name, ex.Message); Nav.NavigateTo("config/edit/lolicode"); } base.OnInitialized(); }
protected override async Task OnInitializedAsync() { config = ConfigService.SelectedConfig; if (config == null) { Nav.NavigateTo("/configs"); return; } try { config.ChangeMode(ConfigMode.LoliCode); } catch (Exception ex) { await OBLogger.LogException(ex); await js.AlertException(ex); } finally { initialized = true; } }