[FL-2226] BadUSB, U2F: missing assets error (#979)
* badusb, u2f: showing error screen if assets are missing * BadUsb: remove dead code * U2F: remove dead code Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "u2f_app_i.h"
|
||||
#include "u2f_data.h"
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
@@ -39,11 +40,19 @@ U2fApp* u2f_app_alloc() {
|
||||
|
||||
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
|
||||
|
||||
// Custom Widget
|
||||
app->widget = widget_alloc();
|
||||
view_dispatcher_add_view(app->view_dispatcher, U2fAppViewError, widget_get_view(app->widget));
|
||||
|
||||
app->u2f_view = u2f_view_alloc();
|
||||
view_dispatcher_add_view(
|
||||
app->view_dispatcher, U2fAppViewMain, u2f_view_get_view(app->u2f_view));
|
||||
|
||||
scene_manager_next_scene(app->scene_manager, U2fAppViewMain);
|
||||
if(u2f_data_check()) {
|
||||
scene_manager_next_scene(app->scene_manager, U2fSceneMain);
|
||||
} else {
|
||||
scene_manager_next_scene(app->scene_manager, U2fSceneError);
|
||||
}
|
||||
|
||||
return app;
|
||||
}
|
||||
@@ -55,6 +64,10 @@ void u2f_app_free(U2fApp* app) {
|
||||
view_dispatcher_remove_view(app->view_dispatcher, U2fAppViewMain);
|
||||
u2f_view_free(app->u2f_view);
|
||||
|
||||
// Custom Widget
|
||||
view_dispatcher_remove_view(app->view_dispatcher, U2fAppViewError);
|
||||
widget_free(app->widget);
|
||||
|
||||
// View dispatcher
|
||||
view_dispatcher_free(app->view_dispatcher);
|
||||
scene_manager_free(app->scene_manager);
|
||||
|
Reference in New Issue
Block a user