Remove unused _revokeShareLink method and update share link message for clarity
This commit is contained in:
@@ -109,31 +109,6 @@ class _ShareFileDialogState extends State<ShareFileDialog> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _revokeShareLink() async {
|
|
||||||
setState(() {
|
|
||||||
_isLoading = true;
|
|
||||||
_error = null;
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
|
||||||
final apiClient = getIt<ApiClient>();
|
|
||||||
final path = widget.orgId.isEmpty
|
|
||||||
? '/orgs/files/${widget.fileId}/share'
|
|
||||||
: '/orgs/${widget.orgId}/files/${widget.fileId}/share';
|
|
||||||
await apiClient.delete(path);
|
|
||||||
|
|
||||||
setState(() {
|
|
||||||
_shareUrl = null;
|
|
||||||
_isLoading = false;
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
setState(() {
|
|
||||||
_error = 'Failed to revoke share link';
|
|
||||||
_isLoading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _copyToClipboard() {
|
void _copyToClipboard() {
|
||||||
if (_shareUrl != null) {
|
if (_shareUrl != null) {
|
||||||
Clipboard.setData(ClipboardData(text: _shareUrl!));
|
Clipboard.setData(ClipboardData(text: _shareUrl!));
|
||||||
@@ -215,7 +190,7 @@ class _ShareFileDialogState extends State<ShareFileDialog> {
|
|||||||
children: [
|
children: [
|
||||||
if (_shareUrl != null) ...[
|
if (_shareUrl != null) ...[
|
||||||
Text(
|
Text(
|
||||||
'Share link created. Anyone with this link can view and download the file.',
|
'Anyone with this link can view and download the file.',
|
||||||
style: TextStyle(color: AppTheme.secondaryText),
|
style: TextStyle(color: AppTheme.secondaryText),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|||||||
Reference in New Issue
Block a user