Skip to content

Commit

Permalink
Archiver file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
chenilim committed Jan 26, 2021
1 parent 314db69 commit 03ab512
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ debug
__debug_bin
files
octo*.db
focalboard*.db
.eslintcache
.vscode/settings.json
.prettierrc.json
Expand Down
6 changes: 3 additions & 3 deletions mac/Focalboard/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ class ViewController:
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-M-d"
let dateString = dateFormatter.string(from: Date())
let filename = "archive-\(dateString).octo"
let filename = "archive-\(dateString).focalboard"

// Save file
let savePanel = NSSavePanel()
savePanel.canCreateDirectories = true
savePanel.nameFieldStringValue = filename
// BUGBUG: Specifying the allowedFileTypes causes Catalina to hang / error out
//savePanel.allowedFileTypes = [".octo"]
//savePanel.allowedFileTypes = [".focalboard"]
savePanel.begin { (result) in
if result.rawValue == NSApplication.ModalResponse.OK.rawValue,
let fileUrl = savePanel.url {
Expand All @@ -97,7 +97,7 @@ class ViewController:
savePanel.canCreateDirectories = true
savePanel.nameFieldStringValue = filename
// BUGBUG: Specifying the allowedFileTypes causes Catalina to hang / error out
//savePanel.allowedFileTypes = [".octo"]
//savePanel.allowedFileTypes = [".focalboard"]
savePanel.begin { (result) in
if result.rawValue == NSApplication.ModalResponse.OK.rawValue,
let fileUrl = savePanel.url {
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/archiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Archiver {
const content = JSON.stringify(archive)

const date = new Date()
const filename = `archive-${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}.octo`
const filename = `archive-${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}.focalboard`
const link = document.createElement('a')
link.style.display = 'none'

Expand All @@ -56,7 +56,7 @@ class Archiver {
static importFullArchive(onComplete?: () => void): void {
const input = document.createElement('input')
input.type = 'file'
input.accept = '.octo'
input.accept = '.focalboard'
input.onchange = async () => {
const file = input.files && input.files[0]
const contents = await (new Response(file)).text()
Expand Down

0 comments on commit 03ab512

Please sign in to comment.