Add basic news navigation with prev/next buttons
[vchess.git] / client / src / views / Problems.vue
index 9ce2b3f..1884852 100644 (file)
@@ -54,7 +54,7 @@ main
         span.uname ({{ curproblem.uname }})
         button.marginleft(@click="backToList()") {{ st.tr["Back to list"] }}
         button.nomargin(@click="gotoPrevNext($event,curproblem,1)")
-          | {{ st.tr["Previous"] }}
+          | {{ st.tr["Previous_p"] }}
         button.nomargin(@click="gotoPrevNext($event,curproblem,-1)")
           | {{ st.tr["Next_p"] }}
       p.oneInstructions.clickable(
@@ -273,6 +273,7 @@ export default {
       this.loadVariant(prob.vid, () => {
         // Set FEN if possible (might not be correct yet)
         if (V.IsGoodFen(prob.fen)) this.setDiagram(prob);
+        else prob.diag = "";
       });
     },
     loadVariant: async function(vid, cb) {
@@ -291,6 +292,7 @@ export default {
       // variant could not be ready, or not defined
       if (prob.vid > 0 && this.loadedVar == prob.vid && V.IsGoodFen(prob.fen))
         this.setDiagram(prob);
+      else prob.diag = "";
     },
     setDiagram: function(prob) {
       // Condition: prob.fen is correct and global V is ready