1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

webclipper fixes

This commit is contained in:
Andrew Simachev 2024-03-04 13:51:59 +01:00
parent 5731192491
commit f9a10e0042
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
3 changed files with 9 additions and 3 deletions

View file

@ -104,7 +104,7 @@
let html = '';
if (sel.rangeCount) {
const container = document.createElement("div");
const container = document.createElement('div');
for (var i = 0, len = sel.rangeCount; i < len; ++i) {
container.appendChild(sel.getRangeAt(i).cloneContents());
};

View file

@ -115,11 +115,17 @@ const Create = observer(class Create extends React.Component<I.PageComponent, St
initBlocks () {
const { html, tabUrl } = extensionStore;
if (!html || (html == this.html)) {
if (html == this.html) {
return;
};
this.html = html;
blockStore.clear(ROOT_ID);
if (!html) {
this.forceUpdate();
return;
};
C.BlockPreview(html, tabUrl, (message: any) => {
if (message.error.code) {

View file

@ -1,6 +1,6 @@
import * as React from 'react';
import { observer } from 'mobx-react';
import { I, UtilRouter, Storage } from 'Lib';
import { I, Storage } from 'Lib';
import Util from '../lib/util';
const Index = observer(class Index extends React.Component<I.PageComponent> {