Skip to content

Commit

Permalink
refactor: fixed minor mistakes in code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mukund-Tandon committed Aug 14, 2023
1 parent fd6f4c6 commit 17dedc6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ void main() {
await file.writeAsBytes(
data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes),
);
// mock get files

await tester.tapButtonWithName(
LocaleKeys.importPanel_importFromNotionMarkdownZip.tr(),);
Expand All @@ -53,7 +52,7 @@ void main() {
await tester.tapButtonWithName(LocaleKeys.importPanel_uploadZipFile.tr());
tester.expectToSeePageName(mainPageName);
await tester.openPage(mainPageName);
//test the main page is imported correctly
//test if the main page is imported correctly
final mainPageEditorState = tester.editor.getCurrentEditorState();
expect(
mainPageEditorState.getNodeAtPath([0])!.type,
Expand Down Expand Up @@ -110,7 +109,7 @@ void main() {
await tester.expandPage(subPageTwoName);
tester.expectToSeePageName(subSubPageName);

//test if subPage 1 is imported correctly
//test if subpage 1 is imported correctly
await tester.openPage(subPageOneName);
final subPageOneEditorState = tester.editor.getCurrentEditorState();
expect(
Expand All @@ -125,7 +124,7 @@ void main() {
subPageOneEditorState.getNodeAtPath([2])!.type,
ImageBlockKeys.type,
);
//test if subPage 2 is imported correctly
//test if subpage 2 is imported correctly
await tester.openPage(subPageTwoName);
final subPageTwoEditorState = tester.editor.getCurrentEditorState();
expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class ImportFromNotionWidget extends StatelessWidget {
margin: EdgeInsets.zero,
triggerActions: PopoverTriggerFlags.none,
child: FlowyButton(
leftIcon: const FlowySvg(name: 'notion_logo'),
leftIcon: FlowySvg(
name: 'notion_logo',
color: Theme.of(context).colorScheme.tertiary,),
leftIconSize: const Size.square(20),
text: FlowyText.medium(
LocaleKeys.importPanel_importFromNotionMarkdownZip.tr(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ class NotionImporter {
for (final element in files) {
unzipFiles.files.remove(element);
}

for (final element in images) {
unzipFiles.files.remove(element);
}
Expand Down Expand Up @@ -191,10 +190,10 @@ class NotionImporter {
// we take all contents of a markdown file and pass it through
// _preProcessMarkdownFile function which returns us a string which is the
// contents of the markdown file but with changes. The changes this function
//performs are related to images . It will iterate through each line and if it
// performs are related to images .It will iterate through each line and if it
// it finds something like ![name](path) this is how a image is represented in
// markdown . When we get this line is detected we get the path from this
// this path is actually the file name of image from the above unzipfiles
// markdown , we get this line if detected, we get the path from this.
// This path is actually the file name of image from the above unzipfiles
// so with the help of path we will get the image file and save it
// locally and change the current path to the path where the image is saved
// locally
Expand Down

0 comments on commit 17dedc6

Please sign in to comment.