cn0303 commited on
Commit
49823c5
·
verified ·
1 Parent(s): ef62a95

Fix: re-parsing a machine without a GPU now clears the previous GPU selection

Browse files
Files changed (1) hide show
  1. static/app.js +13 -0
static/app.js CHANGED
@@ -797,6 +797,17 @@ function applyParsed(d, hint) {
797
  setActive("#provider-seg", d.provider);
798
  fillGpu();
799
  got.push(d.provider.toUpperCase());
 
 
 
 
 
 
 
 
 
 
 
800
  }
801
  if (d.gpu) {
802
  const sel = $("#gpu");
@@ -808,6 +819,8 @@ function applyParsed(d, hint) {
808
  } else if (d.vram_gb) {
809
  $("#vram").value = d.vram_gb;
810
  got.push(`${d.vram_gb} GB VRAM`);
 
 
811
  }
812
  if (d.ram_gb) {
813
  const ram = $("#ram");
 
797
  setActive("#provider-seg", d.provider);
798
  fillGpu();
799
  got.push(d.provider.toUpperCase());
800
+ } else {
801
+ // Graphics not mentioned: reset to "unspecified" so a previous machine's GPU
802
+ // does not carry over (the parser returns null, not "none", on purpose, since
803
+ // it must not assume). Respect computer limits: a Mac stays Apple, since
804
+ // syncProviderForComputer already forced it and "unsure" is not allowed there.
805
+ const allowed = PROVIDER_ALLOWED[state.computer] || ["none", "nvidia", "amd", "intel", "apple", "unsure"];
806
+ if (allowed.includes("unsure")) {
807
+ state.provider = "unsure";
808
+ setActive("#provider-seg", "unsure");
809
+ fillGpu();
810
+ }
811
  }
812
  if (d.gpu) {
813
  const sel = $("#gpu");
 
819
  } else if (d.vram_gb) {
820
  $("#vram").value = d.vram_gb;
821
  got.push(`${d.vram_gb} GB VRAM`);
822
+ } else {
823
+ $("#vram").value = ""; // no GPU or VRAM mentioned: clear any stale value from a prior parse
824
  }
825
  if (d.ram_gb) {
826
  const ram = $("#ram");