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:
parent
5731192491
commit
f9a10e0042
3 changed files with 9 additions and 3 deletions
2
dist/extension/js/background.js
vendored
2
dist/extension/js/background.js
vendored
|
@ -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());
|
||||
};
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue