Sfoglia il codice sorgente

Check fix

- Fixes selected check
acegoal07 2 anni fa
parent
commit
df5a44e5d0
3 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 1 0
      nfc_playlist.h
  2. 2 2
      scences/emulation.c
  3. 1 0
      scences/file_select.c

+ 1 - 0
nfc_playlist.h

@@ -44,6 +44,7 @@ typedef struct {
    FuriString* base_file_path;
    FuriString* file_path;
    bool file_selected;
+   bool file_selected_check;
 } NfcPlaylist;
 
 static const int options_emulate_timeout[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };

+ 2 - 2
scences/emulation.c

@@ -62,7 +62,7 @@ int32_t nfc_playlist_emulation_task(void* context) {
     popup_set_context(nfc_playlist->popup, nfc_playlist);
     view_dispatcher_switch_to_view(nfc_playlist->view_dispatcher, NfcPlaylistView_Popup);
 
-    if(file_stream_open(stream, furi_string_get_cstr(nfc_playlist->file_path), FSAM_READ, FSOM_OPEN_EXISTING) && nfc_playlist->file_selected) {
+    if(file_stream_open(stream, furi_string_get_cstr(nfc_playlist->file_path), FSAM_READ, FSOM_OPEN_EXISTING) && nfc_playlist->file_selected_check) {
         EmulationState = NfcPlaylistEmulationState_Emulating;
         int file_position = 0;
         while(stream_read_line(stream, line) && EmulationState == NfcPlaylistEmulationState_Emulating) {
@@ -146,7 +146,7 @@ int32_t nfc_playlist_emulation_task(void* context) {
         EmulationState = NfcPlaylistEmulationState_Stopped;
     } 
     
-    else if (!nfc_playlist->file_selected) {
+    else if (!nfc_playlist->file_selected_check) {
         popup_set_header(nfc_playlist->popup, "No playlist selected", 64, 10, AlignCenter, AlignTop);
         popup_set_text(nfc_playlist->popup, "Press back", 64, 50, AlignCenter, AlignTop);
     } 

+ 1 - 0
scences/file_select.c

@@ -3,6 +3,7 @@
 
 void nfc_playlist_file_select_menu_callback(void* context) {
    NfcPlaylist* nfc_playlist = context;
+   nfc_playlist->file_selected_check = true;
    scene_manager_previous_scene(nfc_playlist->scene_manager);
 }