Enhance file sharing functionality: infer org_id when not provided, update share link responses to include shareUrl
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:web/web.dart' as web;
|
||||
import '../theme/app_theme.dart';
|
||||
import '../services/api_client.dart';
|
||||
import '../injection.dart';
|
||||
import '../widgets/audio_player_bar.dart';
|
||||
|
||||
class PublicFileViewer extends StatefulWidget {
|
||||
final String token;
|
||||
@@ -117,12 +118,23 @@ class _PublicFileViewerState extends State<PublicFileViewer> {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.insert_drive_file,
|
||||
size: 64,
|
||||
color: AppTheme.primaryText,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
// If this is an audio file, show the audio player
|
||||
if ((_fileData!['capabilities']?['mimeType'] ?? '')
|
||||
.toString()
|
||||
.startsWith('audio/')) ...[
|
||||
AudioPlayerBar(
|
||||
fileName: _fileData!['fileName'] ?? 'Audio',
|
||||
fileUrl: _fileData!['downloadUrl'],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
] else ...[
|
||||
Icon(
|
||||
Icons.insert_drive_file,
|
||||
size: 64,
|
||||
color: AppTheme.primaryText,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
Text(
|
||||
_fileData!['fileName'] ?? 'Unknown file',
|
||||
style: TextStyle(
|
||||
|
||||
Reference in New Issue
Block a user