Updated Shortener Admin Page
This commit is contained in:
1 parent
6fec6ce1c7
commit
f948e2b082
4 files changed
+58
-4
No files matched your search
@@ -26,6 +26,8 @@ export class ShortenerComponent implements OnInit, OnDestroy {
|
||||
short_name: string | null = null;
|
||||
deleteId: number | null = null;
|
||||
|
||||
copiedShort: string | null = null;
|
||||
|
||||
constructor(
|
||||
private shortenerService: ShortenerService,
|
||||
private authService: AuthService,
|
||||
@@ -117,4 +119,17 @@ export class ShortenerComponent implements OnInit, OnDestroy {
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
copyShortUrl(shortCode: string): void {
|
||||
const shortUrl = `https://itz.sh/${shortCode}`;
|
||||
|
||||
navigator.clipboard.writeText(shortUrl).then(() => {
|
||||
this.copiedShort = shortCode;
|
||||
|
||||
setTimeout(() => {
|
||||
if (this.copiedShort === shortCode) this.copiedShort = null;
|
||||
}, 2000);
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user