mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Auto unlock rpc for u2f
This commit is contained in:
@@ -25,31 +25,6 @@ void u2f_scene_error_on_enter(void* context) {
|
||||
"No SD card or\napp data found.\nThis app will not\nwork without\nrequired files.");
|
||||
widget_add_button_element(
|
||||
app->widget, GuiButtonTypeLeft, "Back", u2f_scene_error_event_callback, app);
|
||||
} else if(app->error == U2fAppErrorCloseRpc) {
|
||||
widget_add_icon_element(app->widget, 78, 0, &I_ActiveConnection_50x64);
|
||||
if(XTREME_SETTINGS()->is_nsfw) {
|
||||
widget_add_string_multiline_element(
|
||||
app->widget, 3, 2, AlignLeft, AlignTop, FontPrimary, "I am not\na whore!");
|
||||
widget_add_string_multiline_element(
|
||||
app->widget,
|
||||
3,
|
||||
30,
|
||||
AlignLeft,
|
||||
AlignTop,
|
||||
FontSecondary,
|
||||
"Pull out from\nPC or phone to\nuse me like this.");
|
||||
} else {
|
||||
widget_add_string_multiline_element(
|
||||
app->widget, 3, 2, AlignLeft, AlignTop, FontPrimary, "Connection\nis active!");
|
||||
widget_add_string_multiline_element(
|
||||
app->widget,
|
||||
3,
|
||||
30,
|
||||
AlignLeft,
|
||||
AlignTop,
|
||||
FontSecondary,
|
||||
"Disconnect from\nPC or phone to\nuse this function.");
|
||||
}
|
||||
}
|
||||
|
||||
view_dispatcher_switch_to_view(app->view_dispatcher, U2fAppViewError);
|
||||
|
||||
@@ -49,17 +49,13 @@ U2fApp* u2f_app_alloc() {
|
||||
view_dispatcher_add_view(
|
||||
app->view_dispatcher, U2fAppViewMain, u2f_view_get_view(app->u2f_view));
|
||||
|
||||
if(furi_hal_usb_is_locked()) {
|
||||
app->error = U2fAppErrorCloseRpc;
|
||||
scene_manager_next_scene(app->scene_manager, U2fSceneError);
|
||||
} else {
|
||||
furi_hal_usb_unlock();
|
||||
if(u2f_data_check(true)) {
|
||||
scene_manager_next_scene(app->scene_manager, U2fSceneMain);
|
||||
} else {
|
||||
app->error = U2fAppErrorNoFiles;
|
||||
scene_manager_next_scene(app->scene_manager, U2fSceneError);
|
||||
}
|
||||
}
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
typedef enum {
|
||||
U2fAppErrorNoFiles,
|
||||
U2fAppErrorCloseRpc,
|
||||
} U2fAppError;
|
||||
|
||||
typedef enum {
|
||||
|
||||
Reference in New Issue
Block a user