Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add admin ID and modification secret to local storage to enable deleting map #291

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { qrcodeStyling } from './qrcode-settings';
import { API_URL, HttpService } from 'src/app/core/http/http.service';
import { UtilsService } from 'src/app/core/services/utils/utils.service';
import { ToastrService } from 'ngx-toastr';
import { StorageService } from 'src/app/core/services/storage/storage.service';

@Component({
selector: 'teammapper-dialog-share',
Expand Down Expand Up @@ -31,7 +32,8 @@ export class DialogShareComponent implements OnInit {
constructor(
private httpService: HttpService,
private toastrService: ToastrService,
private utilsService: UtilsService
private utilsService: UtilsService,
private storageService: StorageService
) {}

ngOnInit() {
Expand Down Expand Up @@ -77,6 +79,13 @@ export class DialogShareComponent implements OnInit {
);
this.toastrService.success(sucessMessage);

await this.storageService.set(newMap.map.uuid, {
adminId: newMap.adminId,
modificationSecret: newMap.modificationSecret,
ttl: newMap.map.deletedAt,
rootName: newMap.map.data[0].name,
});

// Built in delay to allow users to read the toast (if we redirect immediately the toast gets swallowed up)
// The reason we're doing a client-side replace and not server-side redirect is to make sure all client-side data is refreshed
setTimeout(
Expand Down
Loading