Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dropdown colour #2

Merged
merged 2 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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