Skip to content

Commit

Permalink
fix: incorrect event receiving behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
d1snin committed Apr 25, 2024
1 parent edb9b51 commit 753833c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ class SpaceListingComponent : Component<Unit>(), KoinComponent {

private val beamClient by inject<BeamClient>()

private val emptySpaces: FetchedSpaces = listOf<Space>() to 0

private val spaces = ObservableValue(emptySpaces)
private val spaces = ObservableValue(emptyList)

private val paginator by lazy {
val limit = if (currentSpace != null) PAGE_LIMIT + 1 else PAGE_LIMIT
Expand Down Expand Up @@ -110,7 +108,7 @@ class SpaceListingComponent : Component<Unit>(), KoinComponent {

private fun SimplePanel.reset() {
getChildren().forEach { it.dispose() }
spaces.value = emptySpaces
spaces.value = emptyList
paginator.currentPage = 0
initialized.value = false
}
Expand Down Expand Up @@ -232,5 +230,7 @@ class SpaceListingComponent : Component<Unit>(), KoinComponent {
private companion object {

private const val PAGE_LIMIT = 4

private val emptyList: FetchedSpaces = listOf<Space>() to 0
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ kotlinxSerializationVersion=1.6.0
ktorServerLiquibaseVersion=1.1.2
ktorStaticAuthVersion=2.0.1-dev-70ec026

ktorWsEventsVersion=1.1.1
ktorWsEventsVersion=1.1.1-dev-13b12e9

logbackVersion=1.5.5
kmLogVersion=1.4.2
Expand Down
24 changes: 12 additions & 12 deletions http/daemon.http
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### POST Space
POST http://localhost:8573/api/spaces
Authorization: Bearer {{token}}
Content-Type: application/json

{
Expand All @@ -12,8 +13,8 @@ Content-Type: application/json
"icon": null,
"favicon": null,
"preview": null,
"title": "Test space 1",
"description": "Test space instance.",
"title": "test",
"description": "test",
"remark": null
}
}
Expand All @@ -36,7 +37,7 @@ Content-Type: application/json
}

### GET Space
GET http://localhost:8573/api/spaces/root?language=en
GET http://localhost:8573/api/spaces/917824b0-3b07-42f3-951a-dc81e30fde18?language=en

### GET Spaces
GET http://localhost:8573/api/spaces?limit=10&offset=0
Expand All @@ -55,8 +56,8 @@ Content-Type: application/json
"icon": null,
"favicon": null,
"preview": null,
"title": "Test space",
"description": "${root.custom}",
"title": "${test-1.title}",
"description": "${test-1.description}",
"remark": null
}
}
Expand Down Expand Up @@ -155,12 +156,12 @@ Content-Type: application/json
}

### POST Translation
POST http://localhost:8573/api/translations?space=root
POST http://localhost:8573/api/translations?space=test-1
Authorization: Bearer {{token}}
Content-Type: application/json

{
"languageCode": "ru",
"languageCode": "en",
"languageName": null,
"default": false,
"translations": {
Expand All @@ -175,15 +176,14 @@ Content-Type: application/json
"ui.failure-card.not-found.message": "Мы ничего не нашли.",
"ui.failure-card.empty-space.icon-alt": "Иконка пустого пространства",
"ui.failure-card.empty-space.message": "Эта страница выглядит пустой.",
"ui.footer.message.first-part": "Работает на движке",
"ui.footer.message.second-part": "Beam",
"ui.footer.source-code-link.message": "Исходный код на GitHub",
"ui.footer.source-code-link.url": "https://github.com/d1snin/beam",
"ui.failure-card.lost-connection.icon-alt": "Иконка потерянного соединения",
"ui.failure-card.lost-connection.message": "Соединение с сервером прервано...",
"ui.footer.language-switcher.message": "Поменять язык...",
"ui.space-listing.message": "Другие страницы:",
"ui.space-listing.fetch-more-button": "Загрузить больше",
"ui.block.collapsed-content-entity.button.message": "Подробнее",
"root.custom": "ru"
"test-1.title": "en title",
"test-1.description": "en description"
}
}

Expand Down

0 comments on commit 753833c

Please sign in to comment.