Skip to content

Commit

Permalink
Merge pull request #2 from jacobmichels/fix-dropdown-colour
Browse files Browse the repository at this point in the history
Fix dropdown colour
  • Loading branch information
jacobmichels authored Apr 27, 2020
2 parents 2893c41 + 577fb08 commit d69a1cf
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 13 deletions.
2 changes: 2 additions & 0 deletions electron/src/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<div class="bg-color card z-depth-4" >
<div class="card-content white-text">
<span id="title" class="card-title">&#127959; Configuration</span>
<p id="message"></p>
</div>
<div class="card-action">
<div class="input-field">
Expand All @@ -47,6 +48,7 @@
<option value="wait">Wait until last second to accept</option>
</select>
</div>
<a onclick="test()" class="waves-effect red waves-light btn">test pushed id</a>
<a onclick="cancel()" class="waves-effect red waves-light btn">cancel</a>
<a onclick="save()" class="waves-effect red waves-light btn">save and exit</a>
</div>
Expand Down
20 changes: 14 additions & 6 deletions electron/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

// $($)
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");
}
})
}
2 changes: 1 addition & 1 deletion electron/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ html,body {
}

input{
color: #9e9e9e;
color: #ffffff;
font-size:1rem !important;
}
25 changes: 19 additions & 6 deletions firebase/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit d69a1cf

Please sign in to comment.