From 24e25e2646bb861e36e4eca701b3f4409aaac789 Mon Sep 17 00:00:00 2001 From: Jacob Date: Mon, 27 Apr 2020 12:46:21 -0400 Subject: [PATCH 1/2] added test notification --- electron/src/config.html | 2 ++ electron/src/config.js | 20 ++++++++++++++------ firebase/functions/index.js | 25 +++++++++++++++++++------ 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/electron/src/config.html b/electron/src/config.html index b49e3b6..5ceafdb 100644 --- a/electron/src/config.html +++ b/electron/src/config.html @@ -30,6 +30,7 @@
🏗 Configuration +

@@ -47,6 +48,7 @@
+ test pushed id cancel save and exit
diff --git a/electron/src/config.js b/electron/src/config.js index ddf1fa8..b057829 100644 --- a/electron/src/config.js +++ b/electron/src/config.js @@ -64,9 +64,17 @@ save = () => { //save id to file // BrowserWindow.getFocusedWindow().setSize(500, 265); } -function adjust_textarea(h) { - h.style.height = "20px"; - h.style.height = (h.scrollHeight)+"px"; -} - -// $($) \ No newline at end of file +test = () =>{ + let tempID = $('#pushed-id-field').val(); + $.ajax({ + type: 'POST', + data: { "id": tempID, "event": "test" }, + url: 'https://us-central1-lol-boosted.cloudfunctions.net/sendNotification', + success: function (data) { + $('#message').html('Sent test notification to Pushed ID "'+tempID+'"'); + }, + error: function (data) { + $('#message').html("error in http request to firebase"); + } + }) +} \ No newline at end of file diff --git a/firebase/functions/index.js b/firebase/functions/index.js index d240e63..27e21b6 100644 --- a/firebase/functions/index.js +++ b/firebase/functions/index.js @@ -15,12 +15,25 @@ exports.sendNotification = functions.https.onRequest((request, response) => { // console.log(request.query); // response.send("good"); - const formdata = { - "app_key": process.env.app_key, - "app_secret": process.env.app_secret, - "target_type": "pushed_id", - "content": "Your league game is ready!", - "pushed_id":request.body.id, + let formdata; + + if(request.body.event==='test'){ + formdata = { + "app_key": process.env.app_key, + "app_secret": process.env.app_secret, + "target_type": "pushed_id", + "content": "This is a test notification from boosted. If you got this, everything should be working!", + "pushed_id":request.body.id, + } + } + else{ + formdata = { + "app_key": process.env.app_key, + "app_secret": process.env.app_secret, + "target_type": "pushed_id", + "content": "Your league game is ready!", + "pushed_id":request.body.id, + } } https.post({ From 577fb08414e3b47058e74a0836a762964fdb3c88 Mon Sep 17 00:00:00 2001 From: Jacob Date: Mon, 27 Apr 2020 12:52:11 -0400 Subject: [PATCH 2/2] fixed grey dropdown menu in config window --- electron/src/index.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron/src/index.css b/electron/src/index.css index be8665f..c2c78b0 100644 --- a/electron/src/index.css +++ b/electron/src/index.css @@ -75,6 +75,6 @@ html,body { } input{ - color: #9e9e9e; + color: #ffffff; font-size:1rem !important; } \ No newline at end of file