Skip to content

Commit

Permalink
Fix file system duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Aug 28, 2024
1 parent 23e816e commit 25da1ed
Show file tree
Hide file tree
Showing 11 changed files with 207 additions and 208 deletions.
3 changes: 3 additions & 0 deletions api/lib/src/helpers/asset.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ extension AssetFileTypeHelper on AssetFileType {
}

static AssetFileType? fromFileExtension(String? ext) {
if (ext?.startsWith('.') ?? false) {
ext = ext?.substring(1);
}
return AssetFileType.values.firstWhereOrNull(
(type) => type.getFileExtensions().contains(ext),
);
Expand Down
4 changes: 2 additions & 2 deletions api/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ packages:
dependency: "direct main"
description:
path: "packages/lw_file_system_api"
ref: dfda6c2e3cef2e29511f97e9470fd4deb8e0c573
resolved-ref: dfda6c2e3cef2e29511f97e9470fd4deb8e0c573
ref: d9fecade26792a9f79996d373a7ce269b2419fe1
resolved-ref: d9fecade26792a9f79996d373a7ce269b2419fe1
url: "https://github.com/LinwoodDev/dart_pkgs"
source: git
version: "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion api/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
git:
url: https://github.com/LinwoodDev/dart_pkgs
path: packages/lw_file_system_api
ref: dfda6c2e3cef2e29511f97e9470fd4deb8e0c573
ref: d9fecade26792a9f79996d373a7ce269b2419fe1

dev_dependencies:
test: ^1.25.3
Expand Down
2 changes: 1 addition & 1 deletion app/lib/cubits/current_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ class CurrentIndexCubit extends Cubit<CurrentIndex> {
state.absolute ||
location.fileType != AssetFileType.note) {
final document = await fileSystem.createFileWithName(
name: currentData.name, fileExtension: '.bfly', currentData);
name: currentData.name, suffix: '.bfly', currentData);
location = document.location;
} else {
await fileSystem.updateFile(location.path, currentData);
Expand Down
2 changes: 1 addition & 1 deletion app/lib/views/app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class _AppBarTitle extends StatelessWidget {
await state.save(location.copyWith(
path: documentSystem.convertNameToFile(
name: value,
fileExtension: '.bfly',
suffix: '.bfly',
directory: location.parent),
));
}
Expand Down
2 changes: 1 addition & 1 deletion app/lib/views/files/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class FilesViewState extends State<FilesView> {
await _documentSystem.createFileWithName(
directory: path,
name: name,
fileExtension: '.bfly',
suffix: '.bfly',
template.createDocument(
name: name,
));
Expand Down
8 changes: 4 additions & 4 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -823,17 +823,17 @@ packages:
dependency: "direct main"
description:
path: "packages/lw_file_system"
ref: ebc79d7cf461d852cefeb976d2088cca9f7f4702
resolved-ref: ebc79d7cf461d852cefeb976d2088cca9f7f4702
ref: "572c57910afac103e99152c2c7f08860d3541a84"
resolved-ref: "572c57910afac103e99152c2c7f08860d3541a84"
url: "https://github.com/LinwoodDev/dart_pkgs.git"
source: git
version: "1.0.0"
lw_file_system_api:
dependency: transitive
description:
path: "packages/lw_file_system_api"
ref: dfda6c2e3cef2e29511f97e9470fd4deb8e0c573
resolved-ref: dfda6c2e3cef2e29511f97e9470fd4deb8e0c573
ref: d9fecade26792a9f79996d373a7ce269b2419fe1
resolved-ref: d9fecade26792a9f79996d373a7ce269b2419fe1
url: "https://github.com/LinwoodDev/dart_pkgs"
source: git
version: "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ dependencies:
lw_file_system:
git:
url: https://github.com/LinwoodDev/dart_pkgs.git
ref: ebc79d7cf461d852cefeb976d2088cca9f7f4702
ref: 572c57910afac103e99152c2c7f08860d3541a84
path: packages/lw_file_system
flutter_localized_locales: ^2.0.5
dynamic_color: ^1.7.0
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
"@phosphor-icons/react": "^2.1.7",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"astro": "^4.14.4",
"astro": "^4.14.6",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"remark-gemoji": "^8.0.0",
"remark-heading-id": "^1.0.1",
"sharp": "^0.33.5",
"typescript": "^5.5.4"
},
"packageManager": "pnpm@9.8.0",
"packageManager": "pnpm@9.9.0",
"devDependencies": {
"sass": "^1.77.8"
}
Expand Down
Loading

0 comments on commit 25da1ed

Please sign in to comment.