From 544117eec3748393d8ee2279be8de1496db65084 Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Thu, 7 Aug 2025 16:20:00 +0200 Subject: [PATCH] Fix retrieval of preplot previews --- .../src/components/project-settings/preplots-preplot.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/www/client/source/src/components/project-settings/preplots-preplot.vue b/lib/www/client/source/src/components/project-settings/preplots-preplot.vue index 460cf6a..6a0c15d 100644 --- a/lib/www/client/source/src/components/project-settings/preplots-preplot.vue +++ b/lib/www/client/source/src/components/project-settings/preplots-preplot.vue @@ -519,17 +519,18 @@ export default { methods: { async getHead () { - console.log("getHead", this.value?.path); if (this.value?.path) { const url = `/files/${this.value.path}`; const init = { - text: true, headers: { "Range": `bytes=0-${this.sampleSize}` } }; - const head = await this.api([url, init]); - return head?.substring(0, head.lastIndexOf("\n")) || ""; + const opts = {format: "text"}; + const head = await this.api([url, init, null, opts]); + return typeof head === "string" + ? head?.substring(0, head.lastIndexOf("\n")) || "" + : this.head ?? ""; } return ""; },