Use new websocket proto for view counting

This commit is contained in:
2024-04-24 18:47:18 +02:00
parent cf0494d29c
commit ce8ad89d92
2 changed files with 34 additions and 23 deletions

View File

@@ -207,13 +207,6 @@ const open_file_index = async index => {
}
apply_customizations(file)
// Register a file view
fetch(window.api_endpoint + "/file/" + file.id + "/view", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: "token=" + view_token
})
}
const toggle_gallery = () => {
if (view === "gallery") {
@@ -425,7 +418,7 @@ const keyboard_event = evt => {
<div class="file_preview_row">
<div class="toolbar" class:toolbar_visible>
{#if view === "file"}
<FileStats file={file}/>
<FileStats file={file} view_token={view_token}/>
{:else if view === "gallery"}
<ListStats list={list}/>
{/if}