Skip to content

Commit

Permalink
Fix to desktop link hotkeys not working after auto reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
tybayn committed Jan 11, 2025
1 parent df71509 commit d05ad93
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Binary file not shown.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ <h1 id="new_offset" style="display:none;"></h1>
<div class="modifier_volume yfont white">
<img class="zndlinfo" src="imgs/question.png" onclick="showZNDLInfo(event)">
{{desktop_link}}
<a id="zndl-download-icon" class="download" href="assets/ZN-Desktop-Link-Installer-v3.4.0.msi" download="ZN-Desktop-Link-Installer-v3.4.0.msi" onclick="showZNDLInfo(event)"><img class="download_icon" src="imgs/download.png" alt="Download ZN-Desktop-Link"></a>
<a id="zndl-download-icon" class="download" href="assets/ZN-Desktop-Link-Installer-v3.4.1.msi" download="ZN-Desktop-Link-Installer-v3.4.1.msi" onclick="showZNDLInfo(event)"><img class="download_icon" src="imgs/download.png" alt="Download ZN-Desktop-Link"></a>
</div>
<div class="journal_link">
<input type="text" placeholder="DL-XXXXX" id="link_id" class="text" value="" disabled style="color:#444;">
Expand Down Expand Up @@ -504,7 +504,7 @@ <h1 id="new_offset" style="display:none;"></h1>
</div>
<div id="zndl-download-button" class="find-overlay">
{{looking_for_overlay}}<br>
<a href="assets/ZN-Desktop-Link-Installer-v3.4.0.msi" download="ZN-Desktop-Link-Installer-v3.4.0.msi" onclick="showZNDLInfo(event)" style="text-decoration: none;">
<a href="assets/ZN-Desktop-Link-Installer-v3.4.1.msi" download="ZN-Desktop-Link-Installer-v3.4.1.msi" onclick="showZNDLInfo(event)" style="text-decoration: none;">
<div class="button-zn"><img class="download_icon" src="imgs/download.png" style="filter: invert(1); padding-right: 5px;">ZN-Desktop-Link</div>
</a>
</div>
Expand Down Expand Up @@ -980,7 +980,7 @@ <h1 id="new_offset" style="display:none;"></h1>
<script src="wiki-v8/wiki-v1.js"></script>
<script src="scripts-v8/filter-v2.js"></script>
<script src="scripts-v8/sanity-v1.js"></script>
<script src="scripts-v8/wslink-v4.js"></script>
<script src="scripts-v8/wslink-v5.js"></script>
<script src="scripts-v8/zn-v3.js"></script>
<script src="events-v8/events-v1.js"></script>
<script src="models-v8/models-v1.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions info/updates
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version":"3.4.0",
"path":"https://tybayn.github.io/phasmo-cheat-sheet/assets/ZN-Desktop-Link-Installer-v3.4.0.msi"
"version":"3.4.1",
"path":"https://tybayn.github.io/phasmo-cheat-sheet/assets/ZN-Desktop-Link-Installer-v3.4.1.msi"
}
9 changes: 8 additions & 1 deletion scripts-v8/wslink-v4.js → scripts-v8/wslink-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ function link_link(reconnect = false){
}, 30000)
}
if (incoming_state['action'].toUpperCase() == "UNLINK"){
kill_gracefully = true
disconnect_link()
}
if (incoming_state['action'].toUpperCase() == "DL_STEP"){
Expand Down Expand Up @@ -767,6 +768,7 @@ function link_link(reconnect = false){
}

if (incoming_state.hasOwnProperty("disconnect") && incoming_state['disconnect']){
kill_gracefully = true
disconnect_link(false,true)
}

Expand Down Expand Up @@ -961,8 +963,13 @@ function send_reset_link(){
}

function disconnect_link(reset=false,has_status=false){
clearInterval(dlws_ping)
clearInterval(relink_interval)
clearTimeout(relink_timeout)
reconnecting = false
kill_gracefully = false
relink_live = false
relink_interval = null
relink_timeout = null
if(!reset){
if(hasDLLink){
dlws.send('{"action":"KILL"}')
Expand Down

0 comments on commit d05ad93

Please sign in to comment.