mirror of
https://github.com/filecoin-project/slate.git
synced 2024-09-11 22:07:08 +03:00
fixing broken date on markdown files and api key generation and monitor subscribe undefined
This commit is contained in:
parent
7501aad19e
commit
4656540a60
@ -169,7 +169,7 @@ export default class SlateMediaObject extends React.Component {
|
||||
}
|
||||
|
||||
if (file.filename.endsWith(".md") || type.startsWith("text/plain")) {
|
||||
return <MarkdownFrame date={file.data.date} url={url} />;
|
||||
return <MarkdownFrame date={file.createdAt} url={url} />;
|
||||
}
|
||||
|
||||
if (Validations.isPreviewableImage(type)) {
|
||||
|
@ -13,7 +13,8 @@ export default async ({ sanitize = false, publicOnly = false } = {}) => {
|
||||
"files.ownerId",
|
||||
"files.cid",
|
||||
"files.isPublic",
|
||||
"files.data"
|
||||
"files.data",
|
||||
"files.createdAt"
|
||||
)
|
||||
.from("files")
|
||||
.leftJoin("slate_files", "slate_files.fileId", "files.id")
|
||||
|
@ -14,7 +14,8 @@ export default async ({ ids, sanitize = false, publicOnly = false }) => {
|
||||
"files.cid",
|
||||
"files.isPublic",
|
||||
"files.filename",
|
||||
"files.data"
|
||||
"files.data",
|
||||
"files.createdAt"
|
||||
)
|
||||
.from("files")
|
||||
.leftJoin("slate_files", "slate_files.fileId", "=", "files.id")
|
||||
|
@ -14,7 +14,8 @@ export default async ({ id, sanitize = false, publicOnly = false }) => {
|
||||
"files.cid",
|
||||
"files.isPublic",
|
||||
"files.filename",
|
||||
"files.data"
|
||||
"files.data",
|
||||
"files.createdAt"
|
||||
)
|
||||
.from("files")
|
||||
.leftJoin("slate_files", "slate_files.fileId", "=", "files.id")
|
||||
|
@ -14,7 +14,8 @@ export default async ({ slateId, cids }) => {
|
||||
"files.cid",
|
||||
"files.isPublic",
|
||||
"files.filename",
|
||||
"files.data"
|
||||
"files.data",
|
||||
"files.createdAt"
|
||||
)
|
||||
.from("files")
|
||||
.join("slate_files", "slate_files.fileId", "=", "files.id")
|
||||
|
@ -27,7 +27,7 @@ const websocketSend = async (type, data) => {
|
||||
);
|
||||
|
||||
// NOTE(jim): Only allow this to be passed around encrypted.
|
||||
if (ws.readyState === WebSocket.OPEN) {
|
||||
if (ws && ws.readyState === WebSocket.OPEN) {
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
type,
|
||||
|
@ -30,7 +30,7 @@ const websocketSend = async (type, data) => {
|
||||
);
|
||||
|
||||
// NOTE(jim): Only allow this to be passed around encrypted.
|
||||
if (ws.readyState === WebSocket.OPEN) {
|
||||
if (ws && ws.readyState === WebSocket.OPEN) {
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
type,
|
||||
|
@ -304,7 +304,7 @@ export const subscribeSlate = ({ user, targetSlate }) => {
|
||||
const userURL = `<${userProfileURL}|${user.username}>`;
|
||||
|
||||
const targetSlatePageURL = `https://slate.host/$/${targetSlate.id}`;
|
||||
const targetSlateURL = `<${targetSlatePageURL}|${targetSlate.slateId}>`;
|
||||
const targetSlateURL = `<${targetSlatePageURL}|${targetSlate.id}>`;
|
||||
|
||||
const message = `*${userURL}* subscribed to collection:${targetSlateURL}`;
|
||||
Social.sendSlackMessage(message);
|
||||
|
@ -44,6 +44,7 @@ export const sanitizeFile = (entity) => {
|
||||
ownerId: entity.ownerId,
|
||||
isPublic: entity.isPublic,
|
||||
filename: entity.filename,
|
||||
createdAt: entity.createdAt,
|
||||
data: {
|
||||
type: entity.data?.type,
|
||||
name: entity.data?.name,
|
||||
|
6723
package-lock.json
generated
6723
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user