Skip to content

Commit

Permalink
fix bug where Pebble Times would fail to see any cards
Browse files Browse the repository at this point in the history
  • Loading branch information
unlobito committed Jun 6, 2015
1 parent c6ae802 commit 2677848
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,13 @@ static void refresh_layer_deinit(void) {
}

static void update_visible_layers(void) {
const bool refresh_layer_hidden = !updating && persist_exists(STORAGE_NUMBER_OF_CARDS) && persist_read_int(STORAGE_NUMBER_OF_CARDS) != 0;
const bool cards_layer_hidden = updating || !refresh_layer_hidden;
const bool pager_layer_hidden = updating;

uint8_t num_cards = 0;
persist_read_data(STORAGE_NUMBER_OF_CARDS, &num_cards, sizeof(num_cards));

const bool refresh_layer_hidden = !updating && persist_exists(STORAGE_NUMBER_OF_CARDS) && num_cards != 0;
const bool cards_layer_hidden = updating || !refresh_layer_hidden;
const bool pager_layer_hidden = updating;

if (current_page > num_cards - 1) {
current_page = num_cards - 1;
}
Expand Down

0 comments on commit 2677848

Please sign in to comment.