🐛 Bug fixes
This commit is contained in:
@@ -367,6 +367,15 @@ final routerProvider = Provider<GoRouter>((ref) {
|
||||
appId: state.pathParameters['appId']!,
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
name: 'developerBotNew',
|
||||
path: 'bots/new',
|
||||
builder:
|
||||
(context, state) => NewBotScreen(
|
||||
publisherName: state.pathParameters['name']!,
|
||||
projectId: state.pathParameters['projectId']!,
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
name: 'developerBotDetail',
|
||||
path: 'bots/:botId',
|
||||
@@ -377,15 +386,6 @@ final routerProvider = Provider<GoRouter>((ref) {
|
||||
botId: state.pathParameters['botId']!,
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
name: 'developerBotNew',
|
||||
path: 'bots/new',
|
||||
builder:
|
||||
(context, state) => NewBotScreen(
|
||||
publisherName: state.pathParameters['name']!,
|
||||
projectId: state.pathParameters['projectId']!,
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
name: 'developerBotEdit',
|
||||
path: 'bots/:id/edit',
|
||||
|
@@ -282,8 +282,17 @@ class FileUploader {
|
||||
final mime = data.mimeType;
|
||||
if (mime != null && mime.isNotEmpty) return mime;
|
||||
final filename = file.displayName ?? data.name;
|
||||
final detected = lookupMimeType(filename);
|
||||
if (detected != null) return detected;
|
||||
if (filename.isNotEmpty) {
|
||||
final detected = lookupMimeType(filename);
|
||||
if (detected != null) return detected;
|
||||
} else {
|
||||
return switch (file.type) {
|
||||
UniversalFileType.image => 'image/unknown',
|
||||
UniversalFileType.audio => 'audio/unknown',
|
||||
UniversalFileType.video => 'video/unknown',
|
||||
_ => 'application/unknown',
|
||||
};
|
||||
}
|
||||
throw Exception('Cannot detect mime type for file: $filename');
|
||||
} else if (data is List<int> || data is Uint8List) {
|
||||
return 'application/octet-stream';
|
||||
|
Reference in New Issue
Block a user