Skip to content
This repository was archived by the owner on Sep 5, 2020. It is now read-only.

Commit a37053b

Browse files
committed
Prep for Prod
1 parent 23e2d0b commit a37053b

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

src/checkin.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,13 @@ static void init(void) {
241241
}
242242

243243
void checkin_deinit(void) {
244-
APP_LOG(APP_LOG_LEVEL_DEBUG, "Checkin deinit");
245244
layer_destroy_safe(layer_back);
246245
layer_destroy_safe(layer_check);
247246
text_layer_destroy_safe(text_layer_status);
248247
#ifdef PBL_SDK_3
249248
layer_destroy_safe(layer_countdown_bar);
250249
#endif
251250
window_destroy_safe(s_main_window);
252-
APP_LOG(APP_LOG_LEVEL_DEBUG, "Checkin deinit");
253251
}
254252

255253
void checkin_show(void) {

src/checkin_menu.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,8 @@ static void init(void) {
152152
}
153153

154154
void checkin_menu_deinit(void) {
155-
APP_LOG(APP_LOG_LEVEL_DEBUG, "Checkin menu deinit");
156155
window_destroy_safe(s_window);
157-
APP_LOG(APP_LOG_LEVEL_DEBUG, "Checkin menu deinit");
158156
share_menu_deinit();
159-
APP_LOG(APP_LOG_LEVEL_DEBUG, "Checkin menu deinit");
160157
}
161158

162159
void checkin_menu_show(bool menu_mode, char venue_guid[128], char venue_name[512]) {

src/js/pebble-js-app.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ Pebble.addEventListener('showConfiguration',
2323
function(e) {
2424
// TODO: Add the existing user settings to the url
2525
// Pebble.openURL('https://thunsaker.github.io/spoon/config'); // Prod
26-
27-
// Dev
28-
var client_id = 'XVCTS2NLOT3D24JHQBM40MZGWQD1SR5VJMIBXQY2AYQ3WVYC';
29-
var callback_uri = 'http%3A%2F%2Fblog.thomashunsaker.com%2Fspoon%2Fcallback.html';
26+
27+
var client_id = '0KM5OWM4PWMHTEVCDVSWNBPRSXNFLRMODVBP0OGX31JELKR5';
28+
var callback_uri = 'http%3A%2F%2Fthomashunsaker.com%2Fapps%2Fsoup%2Fspoon_callback.html';
3029
if(client_id && callback_uri) {
3130
Pebble.openURL('https://foursquare.com/oauth2/authorize?client_id=' + client_id + '&response_type=token&redirect_uri=' + callback_uri);
3231
} else {
@@ -36,26 +35,23 @@ Pebble.addEventListener('showConfiguration',
3635

3736
Pebble.addEventListener('webviewclosed',
3837
function(e) {
39-
var token = JSON.parse(e.response);
40-
// console.log(token);
41-
if(token !== null) {
42-
if(token.length > 0) {
43-
// console.log("Token " + token);
44-
localStorage.foursquare_token = token;
45-
notifyPebbleConnected(localStorage.foursquare_token.toString());
46-
}
38+
var configuration = JSON.parse(e.response);
39+
if(configuration.result) {
40+
localStorage.foursquare_token = configuration.token;
41+
notifyPebbleConnected(localStorage.foursquare_token.toString());
4742
isNewList = true;
4843
getClosestVenues();
4944
} else {
50-
//Pebble.showSimpleNotificationOnPebble('Spoon', ':( Connection Failed. Try Again.');
45+
Pebble.showSimpleNotificationOnPebble('Spoon', ':( Connection Failed. Try Again.');
5146
}
5247

5348
// if(configuration.theme !== null && configuration.unit !== null) {
5449
// localStorage.spoon_theme = configuration.theme;
5550
// localStorage.spoon_unit = configuration.unit; // 0 == km | 1 == mi
5651
// notifyPebbleConfiguration(configuration.theme);
5752
// }
58-
});
53+
}
54+
);
5955

6056
function notifyPebbleConnected(token) {
6157
// console.log("Sending the token: " + token);
@@ -78,7 +74,8 @@ var error = function(e) {
7874
};
7975

8076
var success = function(position) {
81-
var userToken = localStorage.foursquare_token.toString();
77+
var userToken = localStorage.foursquare_token !== null ?
78+
localStorage.foursquare_token.toString() : null;
8279
if(userToken) {
8380
fetchMostRecentCheckin(userToken);
8481
fetchClosestVenues(userToken, position);

src/share_menu.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,7 @@ static void init(void) {
180180
}
181181

182182
void share_menu_deinit(void) {
183-
APP_LOG(APP_LOG_LEVEL_DEBUG, "Share menu deinit");
184183
window_destroy_safe(s_window);
185-
APP_LOG(APP_LOG_LEVEL_DEBUG, "Share menu deinit");
186184
}
187185

188186
void share_menu_show(bool menu_mode, char venue_guid[128], char venue_name[512]) {

0 commit comments

Comments
 (0)