-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from a-ng-d/ui-color-palette-410
UI Color Palette 4.1.0
- Loading branch information
Showing
75 changed files
with
1,191 additions
and
785 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,38 @@ | ||
import { releaseNotesVersion } from '../../utils/config' | ||
const checkHighlightStatus = async (remoteVersion: string) => { | ||
// figma.clientStorage.deleteAsync('highlight_version') | ||
// console.log('localVersion', localVersion) | ||
// console.log('remoteVersion', remoteVersion) | ||
const localVersion = await figma.clientStorage.getAsync('highlight_version') | ||
|
||
const checkHighlightStatus = async () => { | ||
// figma.clientStorage.deleteAsync(`${version}_isRead`) | ||
const isRead = await figma.clientStorage.getAsync( | ||
`${releaseNotesVersion}_isRead` | ||
) | ||
|
||
if (isRead === undefined || !isRead) | ||
figma.ui.postMessage({ | ||
type: 'CHECK_HIGHLIGHT_STATUS', | ||
if (localVersion === undefined) | ||
return figma.ui.postMessage({ | ||
type: 'PUSH_HIGHLIGHT_STATUS', | ||
data: | ||
figma.payments !== undefined | ||
? figma.payments.getUserFirstRanSecondsAgo() > 60 | ||
? 'UNREAD_RELEASE_NOTE' | ||
: 'READ_RELEASE_NOTE' | ||
: 'READ_RELEASE_NOTE', | ||
}) | ||
else | ||
figma.ui.postMessage({ | ||
type: 'CHECK_HIGHLIGHT_STATUS', | ||
data: 'READ_RELEASE_NOTE', | ||
? 'DISPLAY_HIGHLIGHT_DIALOG' | ||
: 'NO_HIGHLIGHT' | ||
: 'NO_HIGHLIGHT', | ||
}) | ||
else { | ||
const remoteMajorVersion = remoteVersion.split('.')[0], | ||
remoteMinorVersion = remoteVersion.split('.')[1] | ||
|
||
const localMajorVersion = localVersion.split('.')[0], | ||
localMinorVersion = localVersion.split('.')[1] | ||
|
||
if (remoteMajorVersion !== localMajorVersion) | ||
return figma.ui.postMessage({ | ||
type: 'PUSH_HIGHLIGHT_STATUS', | ||
data: 'DISPLAY_HIGHLIGHT_DIALOG', | ||
}) | ||
|
||
if (remoteMinorVersion !== localMinorVersion) | ||
return figma.ui.postMessage({ | ||
type: 'PUSH_HIGHLIGHT_STATUS', | ||
data: 'DISPLAY_HIGHLIGHT_NOTIFICATION', | ||
}) | ||
} | ||
} | ||
|
||
export default checkHighlightStatus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { palettesDbTableName } from '../../utils/config' | ||
import { supabase } from './authentication' | ||
|
||
const sharePalette = async (id: string, isShared: boolean): Promise<void> => { | ||
const now = new Date().toISOString() | ||
|
||
const { error } = await supabase | ||
.from(palettesDbTableName) | ||
.update([ | ||
{ | ||
is_shared: isShared, | ||
published_at: now, | ||
updated_at: now, | ||
}, | ||
]) | ||
.match({ palette_id: id }) | ||
|
||
if (!error) return | ||
else throw error | ||
} | ||
|
||
export default sharePalette |
Oops, something went wrong.