Skip to content

Commit

Permalink
fix: agreementHtml preview screen on generated link bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinyl-Davyl committed Jul 30, 2024
1 parent 93c2cdf commit cf8410f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface DecompressedData {
templateMarkdown: string;
modelCto: string;
data: string;
agreementHtml: string;
}

async function rebuild(template: string, model: string, dataString: string) {
Expand Down Expand Up @@ -149,21 +150,21 @@ const useAppStore = create<AppState>()(
templateMarkdown: state.templateMarkdown,
modelCto: state.modelCto,
data: state.data,
agreementHtml: state.agreementHtml,
});
return `${window.location.origin}/v1?data=${compressedData}`;
},
loadFromLink: async (compressedData: string) => {
try {
const { templateMarkdown, modelCto, data } =
const { templateMarkdown, modelCto, data, agreementHtml } =
decompress(compressedData);
set(() => ({
templateMarkdown,
modelCto,
data,
agreementHtml: "",
agreementHtml,
error: undefined,
}));
await rebuildDeBounce(templateMarkdown, modelCto, data);
} catch (error) {
set(() => ({
error: "Failed to load data from the link",
Expand Down

0 comments on commit cf8410f

Please sign in to comment.