Fix: Complete WOPI integration - resolve all compilation errors

Go backend:
- Clean up corrupted wopi.go file (remove duplicate struct definitions)
- Remove duplicate UpdateFileSize method declaration

Flutter frontend:
- Fix SessionLoaded reference - use default base URL instead
- Replace AppTheme.primary with AppTheme.accentColor
- Remove unused local variables from file_browser_bloc
This commit is contained in:
Leon Bösche
2026-01-12 01:16:07 +01:00
parent 83f0fa0ecb
commit ff51ef8a71
4 changed files with 2 additions and 21 deletions

View File

@@ -191,8 +191,6 @@ class FileBrowserBloc extends Bloc<FileBrowserEvent, FileBrowserState> {
ResetFileBrowser event,
Emitter<FileBrowserState> emit,
) {
emit(DirectoryInitial());
_currentOrgId = event.nextOrgId;
_currentPath = '/';
_currentFiles = [];
_filteredFiles = [];

View File

@@ -416,14 +416,9 @@ class _DocumentViewerModalState extends State<DocumentViewerModal> {
Future<WOPISession> _createWOPISession(String token) async {
try {
final sessionBloc = BlocProvider.of<SessionBloc>(context);
// Get base URL from session state - need to check the state type
// Use default base URL from backend
String baseUrl = 'https://go.b0esche.cloud';
if (sessionBloc.state is SessionLoaded) {
baseUrl = (sessionBloc.state as SessionLoaded).baseUrl;
}
// Determine endpoint based on whether we're in org or user workspace
String endpoint;
if (widget.orgId.isNotEmpty && widget.orgId != 'personal') {
@@ -464,7 +459,7 @@ class _DocumentViewerModalState extends State<DocumentViewerModal> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.description, size: 64, color: AppTheme.primary),
const Icon(Icons.description, size: 64, color: AppTheme.accentColor),
const SizedBox(height: 16),
Text(
'Collabora Online Viewer',

View File

@@ -675,11 +675,3 @@ func (db *DB) MarkChallengeUsed(ctx context.Context, challenge []byte) error {
return err
}
// UpdateFileSize updates the size and last_modified timestamp of a file
func (db *DB) UpdateFileSize(ctx context.Context, fileID uuid.UUID, size int64) error {
_, err := db.ExecContext(ctx, `
UPDATE files
SET size = $1, last_modified = NOW()
WHERE id = $2
`, size, fileID)
return err
}

View File

@@ -115,10 +115,6 @@ type WOPISessionResponse struct {