fix: trash, warnings & note list refresh (#7)

* Fix trash not working

* Fix key not assigned to list warning

* -ms-overflow-style -> msOverflowStyle

* Use timer to refresh note list in navigator

* remove unused code

Co-authored-by: Abdullah Atta <abdullahatta31@gmail.com>
This commit is contained in:
Waqar Ahmed
2020-02-19 22:14:30 +05:00
committed by GitHub
parent ac615667f0
commit 3601d158a9
5 changed files with 6 additions and 9 deletions

View File

@@ -109,7 +109,8 @@ function App() {
scrollbarWidth: "none",
//TODO: need to test this on webkit and internet explorer
"::-webkit-scrollbar": { width: 0, height: 0 },
"-ms-overflow-style": "none"
msOverflowStyle: "none"
//"-ms-overflow-style": "none"
}}
bg={"shade"}
px={0}

View File

@@ -154,6 +154,7 @@ export default class Editor extends React.Component {
clearTimeout(this.timeout);
this.timeout = setTimeout(async () => {
this.id = await this.saveNote();
ev.emit("refreshNotes");
}, 1000);
}
@@ -192,13 +193,8 @@ export default class Editor extends React.Component {
ref={ref => (this.quillRef = ref)}
modules={modules}
theme="snow"
onChange={e => {
onChange={() => {
this.save();
console.log(this.quill.getText());
if (this.quill.getText().length < 20) {
ev.emit("refreshNotes");
}
}}
/>
</Flex>

View File

@@ -139,6 +139,7 @@ const Properties = props => {
justifyContent="center"
alignItems="center"
onClick={() => props.colorSelected && props.colorSelected(color)}
key={color.label}
>
<Icon.Circle
size={40}

View File

@@ -33,7 +33,6 @@ function Home() {
function onRefreshNotes() {
let groups = db.notes.group(undefined, true);
setNotes(groups);
console.log("refreshing notes");
}
onRefreshNotes();
ev.addListener("refreshNotes", onRefreshNotes);

View File

@@ -48,7 +48,7 @@ function Trash() {
return (
<ListView
type="Trash"
getItems={db.trash.al}
getItems={db.trash.all}
menu={{ menuItems, dropdownRefs }}
button={{
content: "Clear Trash",