Skip to content

Commit

Permalink
change progress bar labels + minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jannickheisch committed Dec 12, 2023
1 parent 850025e commit 9967ac8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions android/tinySSB/app/src/main/assets/web/tremola.js
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,7 @@ function b2f_new_event(e) { // incoming SSB log event: we get map with three ent
contact.alias = e.public[1] == "" ? id2b32(e.header.fid) : e.public[1]
contact.initial = contact.alias.substring(0, 1).toUpperCase()
load_contact_list()
load_board_list()

// update names in connected devices menu
for (var l in localPeers) {
Expand Down
8 changes: 4 additions & 4 deletions android/tinySSB/app/src/main/assets/web/tremola_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,26 +534,26 @@ function refresh_connection_progressbar(min_entries, old_min_entries, old_want_e

if(curr_want_entries >= max_entries || old_want_entries == max_entries) {
document.getElementById('connection-overlay-progressbar-want').value = 100
document.getElementById('connection-overlay-progressbar-label-want').textContent = "Requesting — Synchronized"
document.getElementById('connection-overlay-progressbar-label-want').textContent = "Missing — Synchronized"
} else {
var newPosReq = (curr_want_entries - old_want_entries) / (max_entries - old_want_entries) * 100

console.log("newPosMax:", newPosReq)

document.getElementById('connection-overlay-progressbar-want').value = newPosReq
document.getElementById('connection-overlay-progressbar-label-want').textContent = Math.trunc(newPosReq) + "% - " + (max_entries - curr_want_entries) + " entries left"
document.getElementById('connection-overlay-progressbar-label-want').textContent = "Missing - " + (max_entries - curr_want_entries) + " entries left"

}

// update gift progress
if (curr_want_entries <= min_entries || old_min_entries == curr_want_entries) {
document.getElementById('connection-overlay-progressbar-gift').value = 100
document.getElementById('connection-overlay-progressbar-label-gift').textContent = "Offering — Synchronized"
document.getElementById('connection-overlay-progressbar-label-gift').textContent = "Ahead — Synchronized"
} else {
var newPosOff = (min_entries - old_min_entries) / (curr_want_entries - old_min_entries) * 100

document.getElementById('connection-overlay-progressbar-gift').value = newPosOff
document.getElementById('connection-overlay-progressbar-label-gift').textContent = Math.trunc(newPosOff) + "% - " + (curr_want_entries - min_entries) + " entries left"
document.getElementById('connection-overlay-progressbar-label-gift').textContent = "Ahead - " + (curr_want_entries - min_entries) + " entries left"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class WebAppInterface(val act: MainActivity, val webView: WebView) {
}
"importSecret" -> {
act.idStore.setNewIdentity(Base64.decode(args[1], Base64.NO_WRAP))
act.tinyRepo.repo_reset()
act.tinyRepo.reset()

// restart App
if (act.websocket != null)
Expand Down

0 comments on commit 9967ac8

Please # to comment.